Page 1 of 1

[0.12.x Steam] [kovarex] Keybindings when switching operating system

Posted: Sun Apr 24, 2016 7:51 pm
by fandingo
I game on both Windows and Linux, sharing my current save via Steam syncing. I've noticed that when I switch from one to the other (doesn't matter which) a few of the keybindings break. The most important being enter/leave vehicle. It always gets set to a red unknown value.

Screenshot of the most recent Windows -> Linux transition:

Image

I haven't customized any settings. Everything setting is stock.

Re: Keybindings when switching operating system

Posted: Mon Apr 25, 2016 12:29 pm
by Klonan
Thanks for the report,

Seems like it could be a big problem moving forward

Re: [0.12.x Steam] Keybindings when switching operating system

Posted: Tue Apr 26, 2016 3:48 am
by fandingo
Here's a screen shot of a Linux -> Windows transition:

Image

One thing I noticed was "show info." On Linux, it seems that the ALT keys show up separately. I use the left alt key in both operating systems. On Linux, Factorio shows the keybinding as ALT_L, but in Widows, it's just ALT. It may be a similar problem with enter/leave vehicle. If I remember correctly, it shows up as RETURN in Linux, but looking at Windows right now, it's ENTER. (That could be wrong. I didn't double check Linux.) (It's probably the same with the Lua console where SHIFT_L + ` is interferring with Windows' SHIFT + `.

I won't speculate too much about the input handling since I obviously don't have the source code. Nonetheless, perhaps there's a more generic representation of these keys available in your libraries that would treat ALT, ALT_L, and ALT_R the same and similarly for ENTER and RETURN.

Re: [0.12.x Steam] Keybindings when switching operating system

Posted: Tue Apr 26, 2016 11:06 am
by kovarex
They keys are defined by the system, so there isn't easy general solution.

I made a translation table to standardize some of the key codes, I added

Code: Select all

RETURN->ENTER
ALT_L->ALT
ALT_R->ALT
If you give me more info (the config after saving the keys in linux would help. I can put more values there. (Like the numpad +/- or the console key)

Re: [0.12.x Steam] [kovarex] Keybindings when switching operating system

Posted: Wed Apr 27, 2016 4:38 am
by fandingo
Here's my config in Linux after getting the keys fixed.
Config
Turns out I was wrong about SHIFT_L; it's always just SHIFT. I was right about ENTER/RETURN, though.

When I switched back to Linux today, I noticed that the Lua console binding wasn't broken, which was a little surprising. The only two with problems were RETURN and ALT_L, and it sounds like your patch covers that perfectly.


Thanks so much for looking into this. It's not a major problem by any stretch, but I'm really thankful how seriously you take the quality.

I doubt this is important, but worth mentioning that I'm using a US QWERTY keyboard with standard "us" layout (reported by setxkbmap).