mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 17:11:52 +08:00
hid: using KEY_ERROR_UNDEFINED instead of 0
This commit is contained in:
@@ -89,6 +89,6 @@ INLINE KeyboardKeycode keymap(uint8_t code) {
|
||||
case 24: return KEY_X;
|
||||
case 25: return KEY_Y;
|
||||
case 26: return KEY_Z;
|
||||
default: return 0;
|
||||
default: return KEY_ERROR_UNDEFINED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@ INLINE void cmdResetHid() {
|
||||
INLINE void cmdKeyEvent() {
|
||||
uint8_t state = CMD_SERIAL.read();
|
||||
KeyboardKeycode code = keymap((uint8_t)CMD_SERIAL.read());
|
||||
CMD_SERIAL.read(); // unused now
|
||||
if (code) {
|
||||
if (code != KEY_ERROR_UNDEFINED) {
|
||||
if (state) {
|
||||
Keyboard.press(code);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user