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 F401RE-USBHost by
Diff: USBHostHID/USBHostKeyboard.cpp
- Revision:
- 24:75435a7ab25b
- Parent:
- 9:7f9f64cf5ded
- Child:
- 25:e649a2609020
--- a/USBHostHID/USBHostKeyboard.cpp Sun May 01 03:18:11 2016 +0000
+++ b/USBHostHID/USBHostKeyboard.cpp Sun Oct 30 15:58:04 2016 +0000
@@ -133,6 +133,7 @@
return false;
}
+// this is called every keyboard update, including presses, releases and every so often
void USBHostKeyboard::rxHandler() {
int len = int_in->getLengthTransferred();
int index = (len == 9) ? 1 : 0;
@@ -140,7 +141,12 @@
uint8_t key = 0;
if (len == 8 || len == 9) {
uint8_t modifier = (report[index] == 4) ? 3 : report[index];
- len_listen = len;
+ len_listen = len;
+ // add new callback to send raw state
+ if (onKeyRaw)
+ {
+ (*onKeyRaw)(report);
+ }
key = keymap[modifier][report[index + 2]];
if (key && onKey) {
(*onKey)(key);
