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

Scroll Lock and Num Lock support #80

Closed
theboyknowsclass opened this issue Sep 19, 2021 · 3 comments
Closed

Scroll Lock and Num Lock support #80

theboyknowsclass opened this issue Sep 19, 2021 · 3 comments

Comments

@theboyknowsclass
Copy link

Hi, does anyone know of any way to emulate these keys?

I'm trying to add some extra controls to a KVM and those are quite often used

@Gadgetoid
Copy link
Member

Looks like they're just scancodes like everything else- https://gist.github.com/MightyPork/6da26e382a7ad91b5496ee55fdc73db2

Caps Lock is already implemented like so:

keybow.CAPSLOCK = 0x39

So maybe:

keybow.NUMLOCK = 0x43
keybow.SCROLLLOCK = 0x47

will work when coupled with the regular key press/release example here:

#67

keybow.set_key(keybow.NUMLOCK, keybow.KEY_DOWN)
keybow.tap_key(...)
keybow.set_key(keybow.NUMLOCK, keybow.KEY_UP)

@theboyknowsclass
Copy link
Author

theboyknowsclass commented Oct 1, 2021

hi @Gadgetoid - Thanks so much for this! (btw looking at that link NUM_LOCK is 0x53)

weirdly. once I set these and have the following layout - the keybow seems to crash as soon as I hit the scrolllock (it triggers correctly the first time, but after that no keypresses work) - any ideas?

require "keybow"

-- Standard number pad mapping --

-- Key mappings --

function handle_key_00(pressed)
    keybow.set_key(keybow.SCROLLLOCK, pressed)
end

function handle_key_01(pressed)
    keybow.set_key(keybow.NUMLOCK, pressed)
end

@theboyknowsclass
Copy link
Author

anyone else tried this? or can reproduce?

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

No branches or pull requests

2 participants