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

custom keycode for OtherKey #35

Open
Corallus-Caninus opened this issue Jul 30, 2021 · 3 comments
Open

custom keycode for OtherKey #35

Corallus-Caninus opened this issue Jul 30, 2021 · 3 comments

Comments

@Corallus-Caninus
Copy link

I cant seem to get OtherKey() to work with the enumeration. Ive tried the hex code returned from xev and the uint returned from showkey. Is there further documentation or a working example?

Thanks.

@Yusuf007R
Copy link

Same here, did you manage to get it to work?

@joseluisq
Copy link

Also interested in this. Any hint on how to get other keys via the OtherKey?

@LoVicente
Copy link

I figured out how to bind to OtherKey (windows) so I'm sharing what worked for me, unsure if it's the correct way of doing things since this is my first time touching rust:

OtherKey(0xe2).bind(move || {
        //...
});

To get the code I used this website: https://kbdlayout.info/

You need to pick your keyboard layout and then check the Virtual Key for the Scan Code you need.

For example, I'm capturing the angle bracket key (<) for the Spanish Keyboard layout: https://kbdlayout.info/kbdsp/virtualkeys (it's next to left shift):

SC VK Name
56 E2 VK_OEM_102

The key is called VK_OEM_102 internally, and the scan code is 56, but the virtual key is E2. So the correct value is 0xe2, as per the code above.

It can be a bit confusing because for example, using 56 here would match instead the letter V (VK_V):

SC VK Name
2F 56 VK_V

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

4 participants