diff options
Diffstat (limited to 'hid/lib/drivers-stm32/usb/keymap.h.mako')
-rw-r--r-- | hid/lib/drivers-stm32/usb/keymap.h.mako | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hid/lib/drivers-stm32/usb/keymap.h.mako b/hid/lib/drivers-stm32/usb/keymap.h.mako index 82fd9b08..3e2324ef 100644 --- a/hid/lib/drivers-stm32/usb/keymap.h.mako +++ b/hid/lib/drivers-stm32/usb/keymap.h.mako @@ -22,14 +22,16 @@ #pragma once -#include "keycode.h" - <%! import operator %> -KeyboardKeycode keymapUsb(uint8_t code) { +uint8_t keymapUsb(uint8_t code) { switch (code) { % for km in sorted(keymap, key=operator.attrgetter("mcu_code")): - case ${km.mcu_code}: return ${km.arduino_name}; + % if km.usb_key.is_modifier: + case ${km.mcu_code}: return ${km.usb_key.arduino_modifier_code}; // ${km.web_name} + % else: + case ${km.mcu_code}: return ${km.usb_key.code}; // ${km.web_name} + % endif % endfor - default: return KEY_ERROR_UNDEFINED; + default: return 0; } } |