-
-
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
Add support for non-ascii input bindings #2915
Comments
(Note: I'm not a C++ programmer, this is just my opinion as a game user and developer) There are generally two ways to handle input in games:
Each has their upsides and downsides:
Note: I call it the "UNIX way" because it's generally how input is handled in games on GNU/Linux and BSD, but SDL2 actually behaves like the "Windows way", even on GNU/Linux or BSD. This can be seen in games like Team Fortress 2. |
@Calinou Or, go the "smart way": display characters by their keyboard layout, and if the keyboard layout changes, let the underlying button stay the same, but the characters displayed change. I know that this works on X11, dunno about other platforms. |
The current way godot handles this is a bit... bad. First of all, what the code internally refers to scancode is just wrong. See this link for a terminology overview (lead paragraph is enough), and wikipedia uses scancode for the harware level code as well: wiki page for scancode. And secondly, yes, unfortunately there is no way to just sit there and listen for key presses of arbitrary scan coes, to find out which key to listen for. And thirdly, godot should have a way to enable you to listen to raw keycodes (map not applied) too, not just to what godot calls "scancodes". |
godot works this way due to long ago relying on SDL https://www.libsdl.org/release/SDL-1.2.15/docs/html/guideinputkeyboard.html it should be changed to a single u32 key nowadays, the same way as Qt does. On Sat, Nov 28, 2015 at 6:22 PM, est31 [email protected] wrote:
|
another problem is, as far as I remember, X11 will only give you unicode on On Sat, Nov 28, 2015 at 6:38 PM, Juan Linietsky [email protected] wrote:
|
Having a single u32 key includes the problem: which one to take?
|
Good time of day. This issue was given the status of a "feature proposal". It's probably not the most urgent task for the developers of Godot. But let me ask:
|
Fixed by #18020. |
I do not know English (use translator). I find it hard to formulate their thoughts in English. If something (in the text below) is unclear or questionable, please give a leading question. I will try to describe more.
I started developing the game "first person" and faced a problem. Godot does not support international keyboard control. That is, the control works only when the English keyboard layout. Or I did not find the opportunity to make the control does not depend on the keyboard layout.
In the window "Projekt Settings", tab "Input Map" - it is not possible to add non-Latin characters. But even if such a possibility was - it did not solve the problem. Languages very much and can't foresee everything.
For a moment hope gave:
class_input
bool is_key_pressed ( int scancode )
(Table scancode: https://github.com/godotengine/godot/wiki/class_@global-scope)
But it is not the keyboard codes are, the codes of entered characters. As a result, all the same error, switching the keyboard layout leads to a complete breakdown of control in the game to Godot.
This is a very serious error for develop international games. The necessary mechanism for scanning the keyboard (key codes), not that it introduces characters.
The text was updated successfully, but these errors were encountered: