-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Cleanup and unify keyboard input. #70052
Conversation
44b2ee4
to
4c8d2c0
Compare
Can that picture go into official Godot docs? |
In some form, I definitely plan to add it (#69751). |
4c8d2c0
to
f6cf7bf
Compare
This comment was marked as outdated.
This comment was marked as outdated.
95e32a4
to
26ce1ab
Compare
1810420
to
b2f81a0
Compare
501c9d1
to
331afa3
Compare
Added. I guess I should do #71263 for the X11 libs to avoid this kind of issues. |
- Unify keycode values (secondary label printed on a key), remove unused hardcoded Latin-1 codes. - Unify IME behaviour, add inline composition string display on Windows and X11. - Add key_label (localized label printed on a key) value to the key events, and allow mapping actions to the unshifted Unicode events. - Add support for physical keyboard (Bluetooth or Sidecar) handling on iOS. - Add support for media key handling on macOS. Co-authored-by: Raul Santos <raulsntos@gmail.com>
331afa3
to
daad4ae
Compare
Tested on Linux with en_US, fr_FR and da_DK keyboard layouts, seems to work great! Some tests with French AZERTY, pressing all keys from top to bottom (remapping, on a physical US QWERTY):
The same on Danish keyboard layout:
I noticed a difference in the way modifiers are handled, but this may be intentional. Testing on French AZERTY, where:
Pressing Shift+É to get "2" prints:
Pressing Alt Gr+E to get "€" prints:
"€" is actually a key label on that layout: https://en.wikipedia.org/wiki/AZERTY But the same also happens with extended mappings from the Linux keyboard layout which are not printed on the keys, e.g. Alt Gr+W gives "«" and Alt Gr+X gives "»". Those key combinations print:
It's probably different on Windows as these extended mappings are a Linux feature, so this can well be considered working as intended. |
Thanks! |
I'm sorry but I think the change in of From a X11/Wayland perspective the old situation makes more sense? Like, at least the left and right SUPER ("windows") key are really separate keys. I'm not sure about HYPER. Also there's a stale |
None of the other platforms distinguish L/R Super, all use
Indeed, missed them, should be removed. |
Ok, thanks, it wasn't clear to me that META was the same thing. I thought the key was entirely removed. Makes more sense then. |
Yes, this is intentional. All numbers on French keyboards are accessed using |
apologies if that is not within the scope of this PR. didn't find any other place related to |
keycode
values (secondary label printed on a key), remove unused hard-coded Latin-1 codes.key_label
(primary label printed on a key) value to the key events, and allow mapping actions to thekey_label
events.LineEdit
/TextEdit
selected text when IME input begin.keycode
,key_label
andphysical_keycode
set, andunicode
set on key press only when it's relevant.unicode
key down evens, all other keys are ignored while it's active.physical_keycode
.Supported input modes:
Fixes #69830
Fixes #54797
Supersede #53682
Footnotes
Tested with Bluetooth and USB-OTG keyboards. ↩
Tested with Bluetooth and USB-OTG keyboards, Smart Connector case keyboard and Sidecar. ↩
key_label
values aren't supported (generated fromunicode
andkeycode
as fallback). ↩OS on-screen keyboards emulate physical keyboard. ↩ ↩2 ↩3
Using custom virtual keyboard layout. ↩ ↩2