Read keyboard layout from system

Suggestions that have been added to the game.

Moderator: ickputzdirwech

Post Reply
cogwheel
Inserter
Inserter
Posts: 32
Joined: Sun Aug 09, 2015 5:51 pm
Contact:

Read keyboard layout from system

Post by cogwheel »

There are APIs to translate scan codes between QWERTY and whatever the system layout is set to. This means you can keep the physical layout of keybindings the same and just display a different name to the user. E.g. https://wiki.libsdl.org/CategoryKeyboard

Non-QWERTY users would never have to change their key bindings to match their layout, layouts would no longer break when switching between systems. These issues are particularly annoying with a lot of mods.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Read keyboard layout from system

Post by ssilk »

This is quite interesting, but I fear, this is not possible, cause they use Allegro for that.
https://www.allegro.cc/manual/5/keyboard.html
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

cogwheel
Inserter
Inserter
Posts: 32
Joined: Sun Aug 09, 2015 5:51 pm
Contact:

Re: Read keyboard layout from system

Post by cogwheel »

I could be wrong, but it seems they could use this SDL lib just for translating the scan codes even if they don't use it for the actual input handling. The scan codes come from the hardware so they'll be the same in either case.

Alternatively, since SDL is under zlib license, they can copy whatever bits would help get the job done ;)

leoch
Fast Inserter
Fast Inserter
Posts: 135
Joined: Fri Dec 16, 2016 9:37 pm
Contact:

Re: Read keyboard layout from system

Post by leoch »

I'm sure its possible one way or another.

Personally, I gave up translating the keyboard bindings to be usable on my keyboard, and just created a Factorio mapping for my G13 using the existing Factorio bindings. But if you don't have a dedicated gaming keyboard and don't like QWERTY, this doesn't help you much.

cogwheel
Inserter
Inserter
Posts: 32
Joined: Sun Aug 09, 2015 5:51 pm
Contact:

Re: Read keyboard layout from system

Post by cogwheel »


posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Read keyboard layout from system

Post by posila »

Switched to SDL and scancodes in 0.17 https://www.factorio.com/blog/post/fff-259

Post Reply

Return to “Implemented Suggestions”