From c1cadbde4b4a8cc6c6e6248f2762fec0d972689f Mon Sep 17 00:00:00 2001 From: arturo182 Date: Sat, 11 Jun 2022 14:53:08 +0200 Subject: [PATCH] Stop sending ESC over USB on Left Shift Fixes #11 --- app/usb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/usb.c b/app/usb.c index 34cde23..25cf769 100644 --- a/app/usb.c +++ b/app/usb.c @@ -47,6 +47,13 @@ static int64_t timer_task(alarm_id_t id, void *user_data) static void key_cb(char key, enum key_state state) { + // Don't send mods over USB + if ((key == KEY_MOD_SHL) || + (key == KEY_MOD_SHR) || + (key == KEY_MOD_ALT) || + (key == KEY_MOD_SYM)) + return; + if (tud_hid_n_ready(USB_ITF_KEYBOARD) && reg_is_bit_set(REG_ID_CF2, CF2_USB_KEYB_ON)) { uint8_t conv_table[128][2] = { HID_ASCII_TO_KEYCODE }; conv_table['\n'][1] = HID_KEY_ENTER; // Fixup: Enter instead of Return