Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of USBDevice by
Revision 65:31cc40e7864a, committed 2017-04-23
- Comitter:
- jgensel3
- Date:
- Sun Apr 23 19:57:54 2017 +0000
- Parent:
- 64:9b8eb1c0f7d5
- Commit message:
- changed return type
Changed in this revision
USBHID/USBKeyboard.cpp | Show annotated file Show diff for this revision Revisions of this file |
USBHID/USBKeyboard.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/USBHID/USBKeyboard.cpp Sun Apr 23 19:56:19 2017 +0000 +++ b/USBHID/USBKeyboard.cpp Sun Apr 23 19:57:54 2017 +0000 @@ -495,7 +495,7 @@ return true; } -void USBKeyboard::releaseAllKeys(){ +bool USBKeyboard::releaseAllKeys(){ HID_REPORT report; report.data[0] = REPORT_ID_KEYBOARD; report.data[1] = 0; @@ -508,7 +508,10 @@ report.data[8] = 0; report.length = 9; - send(&report); + if (!send(&report)) { + return false; + } + return true; } bool USBKeyboard::mediaControl(MEDIA_KEY key) {
--- a/USBHID/USBKeyboard.h Sun Apr 23 19:56:19 2017 +0000 +++ b/USBHID/USBKeyboard.h Sun Apr 23 19:57:54 2017 +0000 @@ -124,7 +124,7 @@ bool pressKey(uint8_t key, uint8_t modifier = 0); - void releaseAllKeys(); + bool releaseAllKeys(); /** * Send a character