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

This subforum contains all the issues which we already resolved.
fandingo
Inserter
Inserter
Posts: 35
Joined: Fri Apr 22, 2016 4:32 pm
Contact:

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

Post 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.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5286
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Keybindings when switching operating system

Post by Klonan »

Thanks for the report,

Seems like it could be a big problem moving forward
fandingo
Inserter
Inserter
Posts: 35
Joined: Fri Apr 22, 2016 4:32 pm
Contact:

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

Post 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.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post 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)
fandingo
Inserter
Inserter
Posts: 35
Joined: Fri Apr 22, 2016 4:32 pm
Contact:

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

Post 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).
Last edited by daniel34 on Wed Apr 27, 2016 4:09 pm, edited 1 time in total.
Reason: fixed config code spoiler
Post Reply

Return to “Resolved Problems and Bugs”