mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
avr hid: removed KEY_ERROR_UNDEFINED
This commit is contained in:
parent
3ba15e824e
commit
d3dbf19399
@ -99,7 +99,7 @@ class UsbKeyboard : public DRIVERS::Keyboard {
|
|||||||
|
|
||||||
void sendKey(uint8_t code, bool state) override {
|
void sendKey(uint8_t code, bool state) override {
|
||||||
uint8_t usb_code = keymapUsb(code);
|
uint8_t usb_code = keymapUsb(code);
|
||||||
if (usb_code != KEY_ERROR_UNDEFINED) {
|
if (usb_code > 0) {
|
||||||
if (state ? _kbd.add(usb_code) : _kbd.remove(usb_code)) {
|
if (state ? _kbd.add(usb_code) : _kbd.remove(usb_code)) {
|
||||||
_sendCurrent();
|
_sendCurrent();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,6 +134,6 @@ uint8_t keymapUsb(uint8_t code) {
|
|||||||
case 105: return 102; // Power
|
case 105: return 102; // Power
|
||||||
case 106: return 100; // IntlBackslash
|
case 106: return 100; // IntlBackslash
|
||||||
case 107: return 137; // IntlYen
|
case 107: return 137; // IntlYen
|
||||||
default: return KEY_ERROR_UNDEFINED;
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,6 @@ uint8_t keymapUsb(uint8_t code) {
|
|||||||
case ${km.mcu_code}: return ${km.usb_key.code}; // ${km.web_name}
|
case ${km.mcu_code}: return ${km.usb_key.code}; // ${km.web_name}
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
default: return KEY_ERROR_UNDEFINED;
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user