pimoroni / keybow-firmware

Keybow Firmware for the Raspberry Pi Zero

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modifiers are not working correctly with set key vs set text

dfirestorm opened this issue · comments

When using text commands, as demonstrated by boilerplate, the code is currently set up to release the shift key 1 line before the key is released. This results in none of the letters being capitalized even when they should, for example turns into ,code. .

This is tied to the Keybow using modifiers rather than the key inputs for those keys - I changed to the true hex values so that the keys were accessible as single keys, but that prevents them from being used as modifers to any other sources.
To fix this would likely require a full rework of how set key vs text works, as set key with modifiers should be a separate function that uses the hex value and any other use should use the modifier number (0-7)

keybow.LEFT_SHIFT = 1
keybow.LEFT_ALT = 2
keybow.LEFT_META = 3

keybow.RIGHT_CTRL = 4
keybow.RIGHT_SHIFT = 5
keybow.RIGHT_ALT = 6
keybow.RIGHT_META = 7

--[[keybow.LEFT_CTRL = 0xE0
keybow.LEFT_SHIFT = 0xE1
keybow.LEFT_ALT = 0xE2
keybow.LEFT_META = 0xE3

keybow.RIGHT_CTRL = 0xE4
keybow.RIGHT_SHIFT = 0xE5
keybow.RIGHT_ALT = 0xE6
keybow.RIGHT_META = 0xE7]]```

Resolved - is tied to #44 and the fix I used there. Still should be noted in documentation that modifier keys do not work with set_key and instead require set_modifier for whatever reason.