-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix documentation on how to get the keycode string from a physical_keycode
#82092
Fix documentation on how to get the keycode string from a physical_keycode
#82092
Conversation
physical_keycode
.
physical_keycode
.physical_keycode
…eycode` Fixes godotengine#82091. Co-authored-by: Yuri Sizov <[email protected]> Co-authored-by: Rémi Verschelde <[email protected]>
8a993a2
to
1e01fcd
Compare
Added @YuriSizov's suggestion, and further reworked it to be valid code, with a C# example. It's now a full I tested both GDScript and C# snippets successfully. |
Thanks! |
Are we sure the code is working correctly? I am on German QWERTZ keyboard on a Mac where the following happens:
It's really weird, because it seems the Umlauts (ÄÖÜ) fall back to an US keyboard layout but everything else works as expected. Also it doesn't put it out in the user's language but that's probably a different issue/topic (which would be important when showing it to the actual user). |
If you're using
The instruction is for how to convert that physical keycode into a human readable string of that keycode, not of the layout specific keycode, for that use However if it does return It does however seem like you're using |
Ah ok, I understood it as physical refers to the physical keyboard I have in front of me (my bad) ... but there still seems to be a bug somewhere (gosh, how much I hate cross-platform issues). I used the code from the docs:
It seems to mix layouts in a weird manner: Ü = BracketLeft (US) Tested on a MacBook Pro with 14.6.1 (Sonoma) and Godot v4.2.2 IMG_0383.mp4 |
Please open an issue to investigate this, could be many different issues, also please provide a clear log of the results (I'd suggest making sure it prints both the keycode and the physical keycode, both in human readable forms, to evaluate), and an MRP |
Will do! Would the following be a good setup to test it in your opinion:
Which might already have the conclusion:
❌ Pressing ß prints:
❌ Pressing Ä prints:
|
That doesn't look incorrect, remember that there aren't keycodes for symbols not on the US keyboard, they are mapped to the one most relevant, so Compare with the correct layout here |
Both |
Forgot about For more info see here |
Ahhhh! Thanks @bruvzg ❤️ That does the trick! I didn't expect you have to plug something else into I will post an example here for the people that also get confused: Press Ä on a QWERTZ keyboard will result in:
|
Yes PLEASE! |
Bugsquad edit: Linked issue.