Godot Version
v4.7.stable.official [5b4e0cb0f] - Linux x86_64
Question
Hi,
How would we query keyboard input in GDScript for a custom keyboard mapping option?
Also, does current Godot Engine version 4.7 Stable support non-United States keyboards?
Let us know, thank you…
SS
Playable “Alpha # 1” coming very soon:
Could you explain better what you’re looking to achieve? You can use the InputMap to listen to specific keys and input events.
I’m pretty sure the engine doesn’t care what kind of keyboard hardware you have. Overall, your PC doesn’t necessarily know what your physical keyboard layout is, that’s why every single OS has options to set a different layout.
Hi,
Thanks for the reply.
Understood the second keyboard answer.
Is it possible with current Godot Engine version 4.7 Stable to read raw keyboard input?
We are making a 6 player game with player input from keyboard, mouse & 4 game controllers.
We would like to allow the user to bind different keyboard keys to playing game controls.
The default keyboard controls are [Arrows] and [Z] & [X] which might not be best for the player.
In the [Options] screen the user would be able to press [F2] to configure keyboard input keys.
So the game would ask:
- Keyboard key for up action
- Keyboard key for move down
- Keyboard key for move left
- Keyboard key for move right
- Keyboard key for rotate counter-clockwise
- Keyboard key for rotate clockwise
So we need raw keyboard input for the above.
Hope that is understood and that someone know how to do the above, thanks!
SS
Yes.
In the InputMap, if you set up your inputs, simply make sure they’re all set as “PhysicalKey”, this will take only the physical location of the key into account, and will ignore the keyboard layout.
In code, simply handle it using physical_keycode.
Ok, will give it a go in the morning, thanks you.