mirror of
https://github.com/JorjBauer/aiie.git
synced 2024-11-26 11:49:19 +00:00
left behind notes for USB keyboard work
This commit is contained in:
parent
27e023f8ea
commit
8c254e15a0
@ -49,31 +49,26 @@ volatile bool g_writePrefsFromMainLoop = false;
|
|||||||
|
|
||||||
void onKeypress(int unicode)
|
void onKeypress(int unicode)
|
||||||
{
|
{
|
||||||
Serial.print("onKeypress:");
|
/*
|
||||||
Serial.println(unicode);
|
shift/control/command are automatically applied
|
||||||
uint8_t modifiers = usb.getModifiers();
|
caps lock is oemkey 57
|
||||||
Serial.print("Modifiers: ");
|
set the keyboard LED w/ ::capsLock(bool)
|
||||||
Serial.println(modifiers, HEX);
|
modifiers are <<8 bits for the right side:
|
||||||
if (unicode == 0) {
|
command: 0x08; option/alt: 0x04; shift: 0x02; control: 0x01
|
||||||
unicode = usb.getOemKey();
|
F1..F12 are 194..205
|
||||||
Serial.print("oemKey: ");
|
Arrows: l/r/u/d 216/215/218/217
|
||||||
Serial.println(unicode);
|
Delete: 127 (control-delete is 31)
|
||||||
}
|
home/pgup/down/delete/end: 210,211,214,212,213
|
||||||
|
numlock: oem 83
|
||||||
|
keypad: 210..218 as arrows &c, or digit ascii values w/ numlock on
|
||||||
|
enter: 10
|
||||||
|
*/
|
||||||
|
|
||||||
// vmkeyboard->keyDepressed(keypad.key[i].kchar);
|
// vmkeyboard->keyDepressed(keypad.key[i].kchar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onKeyrelease(int unicode)
|
void onKeyrelease(int unicode)
|
||||||
{
|
{
|
||||||
Serial.print("onKeyrelease: ");
|
|
||||||
Serial.println(unicode);
|
|
||||||
uint8_t modifiers = usb.getModifiers();
|
|
||||||
Serial.print("Modifiers: ");
|
|
||||||
Serial.println(modifiers, HEX);
|
|
||||||
if (unicode == 0) {
|
|
||||||
unicode = usb.getOemKey();
|
|
||||||
Serial.print("oemKey: ");
|
|
||||||
Serial.println(unicode);
|
|
||||||
}
|
|
||||||
// vmkeyboard->keyReleased(keypad.key[i].kchar);
|
// vmkeyboard->keyReleased(keypad.key[i].kchar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user