You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this is the intended behaviour when working with physical keys, because I didn't find any information in the docs about this.
Description:
(See example code below for easier understanding)
When I try to access the scancode of a physical button (defined in the Input Map) it always returns 0.
If I retrieve the scan code for a "normal" key it works as intended (e.g. 32 for the space-bar)
Expectation:
My assumption would have been that the scancode equals whatever the current hardware's keys represent.
Example (as explained in the blog post) WASD equals ZQSD on a French keyboard:
That would mean that the scancode for physicalW-key (scancode87) would refer to the Z-key on a French keyboard and thus return the scancode 90
Context
I am trying to make a smooth way to handle different control schemes (a user should be able to switch between control schemes or even create a custom one). I was trying to abstract it to support local multiplayer nicely.
Main code idea: Compare the scancode of an input key with the scancode of the (physical) keys defined in the Input Map.
@KoBeWi
Wow that reply was fast! Thanks for the clarification! ❤️
(As this solves my question I am closing the issue)
I also discovered issue 3571 now which helped me understand a bit more.
I don't really understand why there are separate ways to get the scancode, as the physical_scancode for non-physical keys is 0 (so it seems streamlining to scancode could make sense) ... but I am still learning so there probably is a good reason 🙂
Godot version
v3.4.4.stable.official
System information
macOS Monterey 12.1
Issue description
I am not sure if this is the intended behaviour when working with physical keys, because I didn't find any information in the docs about this.
Description:
0
.32
for thespace
-bar)Expectation:
WASD
equalsZQSD
on a French keyboard:W
-key (scancode87
) would refer to theZ
-key on a French keyboard and thus return the scancode90
Context
Steps to reproduce
Input map
Code
Output
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: