Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use CAPSLOCK as a modifier? #67

Open
kbullockuk opened this issue Nov 1, 2020 · 2 comments
Open

Can we use CAPSLOCK as a modifier? #67

kbullockuk opened this issue Nov 1, 2020 · 2 comments
Labels

Comments

@kbullockuk
Copy link

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)

@Gadgetoid
Copy link
Member

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)

@kbullockuk
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants