-
-
Notifications
You must be signed in to change notification settings - Fork 96
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 keycodes support #156
base: develop
Are you sure you want to change the base?
Add keycodes support #156
Conversation
PUGL_KC_RightShift = 229, | ||
PUGL_KC_RightAlt = 230, | ||
PUGL_KC_RightGUI = 231 | ||
} PuglKeyCodes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to expose this outside of pugl too. Otherwise, the users will have to include pugl.h
to use these keycodes.
Looks good, but a few things to do:
there are a little oddities regarding spaces vs tabs, but I can fix them later myself also, exposing the keycode API would be nice yes :) |
OK, I've made the changes. |
4fa52aa
to
bd702d4
Compare
7599a6e
to
52c2e78
Compare
59cc6ed
to
470c5b7
Compare
8507aec
to
7cd4819
Compare
This is an initial attempt at adding keycodes support to DPF.
These allow to deal with keyboard keys in a layout-independent manner. It's particularly useful for piano-style widgets, to map keyboard keys to piano notes in the correct order.
This code is based on https://github.com/depp/keycode, especially the
<os>_tohid.c
files andkeycode.h
in thesrc
directory.Tested with the piano widget on Linux, MacOS and Windows, with a couple of different layouts (Colemak, AZERTY, QWERTY).
The keycodes would be wrong when running the UI in Wine, but they would work fine on a real Windows 10 machine. I'm not sure if this is normal.
Perhaps it would be good to test this feature a little more before merging.