Skip to content
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

In game inputs from non english layouts should be treated as their qwerty equivalent (like SDL2 scancodes) #8039

Closed
ghost opened this issue Mar 15, 2017 · 14 comments · Fixed by #18020

Comments

@ghost
Copy link

ghost commented Mar 15, 2017

Linux Kubuntu 16.10 Godot 2.1.2 x64 official
Self descriptive. After switching layouts, in game inputs from keyboard are ignored.

Expected behavior: processing inputs as if they are from english layout.

@volzhs
Copy link
Contributor

volzhs commented Mar 15, 2017

duplicated issue with #7106 ?

@ghost
Copy link
Author

ghost commented Mar 15, 2017

Nope. Editor works pretty much as intended it's just that different keyboard languages are not being taken in consideration during input.

@27thLiz
Copy link
Contributor

27thLiz commented Mar 15, 2017

Mhh can't reproduce using a german keyboard layout, all keys seem to trigger the correct input. (OpenSUSE Tumbleweed, both 2.1.2 and master)

@ghost
Copy link
Author

ghost commented Mar 15, 2017

russian and ukrainian layouts not working. Most likely it depends on char type. If char matches english layout then all is cool. Try ö or something like that.

@27thLiz
Copy link
Contributor

27thLiz commented Mar 15, 2017

@ArcFutahito Well german also has some special chars, they work fine however.
Also I just set my layout to russian and it seems to work too:
keyboard

I can even change layouts while the editor is running...

@ghost
Copy link
Author

ghost commented Mar 15, 2017

I am talking game input, not editor input. Add german char to input map and watch game fail.
Sorry, should've clarified it from the start, a bit of a brain fart on my part.

@ghost ghost changed the title Inputs from non english layouts are ignored In game inputs from non english layouts are ignored Mar 15, 2017
@27thLiz
Copy link
Contributor

27thLiz commented Mar 15, 2017

Alright.
Now it might be a duplicate of #2915? :P

@ghost
Copy link
Author

ghost commented Mar 15, 2017

Nope. Issue asks for support of non ascii binding, I ask for input to be layout independent.

@akien-mga
Copy link
Member

Now it might be a duplicate of #2915? :P

Nope. Issue asks for support of non ascii binding, I ask for input to be layout independent.

So, yes, it's a duplicate, but you want a different solution. Doesn't mean it's not the same underlying issue :)

@ghost
Copy link
Author

ghost commented Mar 15, 2017

Well, not really? Binding a non ascii character is different from using non ascii characters with default english binds. Well, whatever makes your cookie crumble :D

@akien-mga akien-mga changed the title In game inputs from non english layouts are ignored In game inputs from non english layouts should be treaty as their qwerty equivalent (like SDL2 scancodes) Mar 15, 2017
@akien-mga akien-mga changed the title In game inputs from non english layouts should be treaty as their qwerty equivalent (like SDL2 scancodes) In game inputs from non english layouts should be treated as their qwerty equivalent (like SDL2 scancodes) Mar 15, 2017
@tomlechner
Copy link

In Linux, maybe this is addressed with the attached patch against master.

I found this due to troubles with modifiers+non-letter keys on a dvorak keyboard causing dropped presses and releases, but maybe it applies also to non-english layouts? If not, I can open a different issue. This is my first time contributing, not totally sure the right place or way to do things!

In the code there seemed to be confusion between X11 keycodes (unique per physical key) and keysyms (might be many per physical key). Godot seems to expect a "scancode" that is basically unique per physical key, but is numerically similar to keysyms or'd with modifiers (unlike native x11 keycodes).

The old code used XLookupString to get a "keycode", but that actually returns a keysym filtered by modifiers, messing things up when doing "out of sync" modifier presses/releases for non-letter keys. Instead using XLookupKeysym(xevent,0) always returns the first in a list of keysyms for that keycode, which as far as I can tell seems to be unique, but I've only tested on a US keyboard (qwerty and dvorak).

godot-patch-fix-x11keycode.txt

@eon-s
Copy link
Contributor

eon-s commented Apr 13, 2018

@tomlechner
Copy link

Thanks. I opened a pull request #18185. On re-reading, this issue hinges on similar sections of code, but my patch doesn't address tracking keys across keyboard mappings.

@rokasv
Copy link

rokasv commented Jun 27, 2018

Bump for Scancode (as opposed to Keycode in SDL terminology) exposure.
Mapping actions to physical key positions is the primary way to correctly handle input for actions.

@akien-mga akien-mga added this to the 4.0 milestone Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants