pimoroni / keybow-firmware

Keybow Firmware for the Raspberry Pi Zero

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we use CAPSLOCK as a modifier?

kbullockuk opened this issue · comments

I have tried to use the following to create a special key combination which is just CAPSLOCK & F12 (for use with Autohotkey) but the keybow doesn't appear to be sending CAPSLOCK, any chance you can make CAPSLOCK a modifier if it isn't already?

keybow.set_modifier(keybow.CAPSLOCK, keybow.KEY_DOWN)
keybow.tap_key(keybow.F12)
keybow.set_modifier(keybow.CAPSLOCK, keybow.KEY_DOWN)

To preserve 12-key-rollover Keybow's set_modifier uses a bitmask set of modifier keys that's limited to 8, with the modifier keys indexed into it like so:

keybow.LEFT_CTRL = 0
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

To press CAPSLOCK you have to treat it like an ordinary key:

keybow.set_key(keybow.CAPSLOCK, keybow.KEY_DOWN)
keybow.tap_key(keybow.F12)
keybow.set_key(keybow.CAPSLOCK, keybow.KEY_UP)

Superb thank you for your quick reply that has saved me a load of messing around!