kriomant / ch57x-keyboard-tool

Utility for programming ch57x small keyboard
MIT License
544 stars 66 forks source link

bug: mapping a single key modifier doesn't allow combo #76

Closed simon-something closed 5 months ago

simon-something commented 6 months ago

After mapping a key to a modifier (shift for instance), it is not possible to use it in combination with another key (if "a" is mapped to another key, one cannot use "shift" plus "a" to get an "A").

When mapping the shift key, the following HID is sent:

[2024-04-23T11:04:42Z DEBUG ch57x_keyboard_tool::keyboard::k884x] bind button 8 on layer 0 to shift
[2024-04-23T11:04:42Z DEBUG ch57x_keyboard_tool::keyboard] send: [03, fd, 09, 01, 01, 00, 00, 00, 00, 00, 01, 02, 00, 00, 00, (...)]

Notice the 01,02 - 02 is the correct id for the modifier (shift here), while the 01 is the expected length of a potential macro. Therefore, the macro/keypress is considered as over after pressing the shift key only (impeding having another key pressed simultaneously).

The behaviour is similar for any other modifier keys set outside in isolation (eg control or command).

juliocargnin commented 6 months ago

Experiencing the same issue here. I have mapped a single key to be ctrl but when I press it with my F11 it does not perform the combo. (I'm in Linux btw)

simon-something commented 5 months ago

77 fixes this too (checked it locally), feel free to check it out (super light change, code should be understandable by anyone) before @kriomant had the chance to review it