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

Add a lot more keycode defines #103

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

dylwhich
Copy link
Contributor

Adds a whole bunch of defines for all the rest of the keycodes. All the existing ones have the same value and none were removed.

Windows keycodes came from here: https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

X11 ones from here: https://www.cl.cam.ac.uk/~mgk25/ucs/keysymdef.h

And the WASM keycodes I got myself from the keyCode attribute of JS events.

@dylwhich
Copy link
Contributor Author

I'm not sure if there's a plan to do anything about KeyboardEvent.keyCode being deprecated since that's the key value that's expected. The new way to handle keys is supposed to be either using .key or .code which don't actually provide numeric codes, so there would probably need to be some translation to make sure the codes are consistent. But the keys are documented pretty well here: https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values

@dylwhich dylwhich force-pushed the more-key-constants branch from d8e1b42 to 67f35dd Compare April 12, 2024 00:18
@cnlohr
Copy link
Member

cnlohr commented Apr 15, 2024

the right way forward here has been under debate. But, this is an incremental change to the status quo. So, I'd like to accept this PR unless you see some other issue with it.

@dylwhich
Copy link
Contributor Author

the right way forward here has been under debate. But, this is an incremental change to the status quo. So, I'd like to accept this PR unless you see some other issue with it.

Okay! Yeah, in that case these changes are ready

@cnlohr cnlohr merged commit d810add into cntools:master Apr 15, 2024
1 check passed
@dylwhich dylwhich deleted the more-key-constants branch April 16, 2024 01:56
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

Successfully merging this pull request may close these issues.

2 participants