ridiculous_coding icon indicating copy to clipboard operation
ridiculous_coding copied to clipboard

Letters are incorrect on non-Qwerty Keyboard layouts

Open AaronRecord opened this issue 5 years ago • 5 comments

I'm currently using the Dvorak keyboard layout and the letter particles that appear are still mapped to Qwerty

AaronRecord avatar Aug 18 '20 16:08 AaronRecord

What OS are you using? I don't know how Dvorak works... are you using software to translate letters (s => o) and you rearranged the keycaps?

It looks like Godot does have some problems with this. There's an open bug https://github.com/godotengine/godot/issues/5503 for detecting keyboard layout.

jotson avatar Aug 20 '20 14:08 jotson

@jotson I'm using Windows 10, Dvorak is just an alternate layout to Qwerty where the letters are arranged by how often they're used (e.g. the most commonly used letters are on the home row) that I'm learning mostly for fun

are you using software to translate letters (s => o)

yes

and you rearranged the keycaps?

no, I just don't look at the keyboard :)

Most programs (Godot included) work normally including all the keyboard shortcuts (e.g. W for move tool) and the only time the keyboard layout actually matters is when you're typing (which is how it probably should work since most keyboard shortcuts are designed for QWERTY). I'd assume it's because they're reading the keyboard input before the letters get mapped to whatever keyboard layout someone is using. This is also true for Godot's input system (e.g. pressing the physical "a" key will trigger "ui left" if I map "ui left" to the "a" key, regardless of what keyboard layout I'm using), but when I'm actually typing (e.g. writing a script or changing the value of a string) then it uses the Dvorak keyboard layout.

AaronRecord avatar Aug 20 '20 20:08 AaronRecord

I've never tried dvorak before. The proximate cause of the problem is in the OS.get_scancode_string method or get_scancode_with_modifiers in Godot. I use that to generate the strings of keys that were pressed like last_key = OS.get_scancode_string(event.get_scancode_with_modifiers())

Someone with a dvorak layout :eyes: who can help troubleshoot the issue will need to file a bug upstream.

jotson avatar Aug 20 '20 20:08 jotson

Idk if this is helpful, but the OS class has a get_latin_keyboard_variant() function:

Returns the current latin keyboard variant as a String.

Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO", "COLEMAK" or "ERROR".

Note: This method is implemented on Linux, macOS and Windows. Returns "QWERTY" on unsupported platforms.

ACB-prgm avatar May 17 '21 16:05 ACB-prgm

I don't think this is an issue any more. Could probably be closed.

jitspoe avatar Jul 05 '23 08:07 jitspoe