Keybinding issues (when remapping keys in OS)

This subforum contains all the issues which we already resolved.
LFarquaad
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Mar 10, 2019 2:24 pm
Contact:

Re: Keybinding issues

Post by LFarquaad »

I am a using the BÉPO keyboard layout, a Dvorak-inspired layout for French. I play on Ubuntu 18.10.

Today I wanted to use an external blueprint, but the usual keyboard shortcuts for pasting didn't work. I tried both CTRL+V and SHIFT+Insert.

I then tried CTRL+., which matches the QWERTY CTRL+V and it works… however it pastes the text TWICE – it took me a moment to understand why blueprints were not accepted (except one for some reason). Similarly, I can cut with CTRL+Y and copy with CTRL+X.

I reproduced the issue with the save dialog, the “LAN player name” field in Other settings and the search item field (in the key bindings screen). This is of course mostly annoying for blueprint strings.

Note that in game, CTRL+Insert and SHIFT+Insert work fine for copy/pasting as I configured them as secondary bindings. These usually have the advantage of being layout independent and my keyboard allows to easily make this combination.

I tried restarting the game with the AZERTY layout and I don't have the problem. However if I then switch to BÉPO while the game is running, pressing CTRL+. now pastes once but also adds the dot.

As a side note, you can probably also reset the key bindings when upgrading to 0.17 for people with a BÉPO layout – it was completely messed up for me with even some Unknown key bindings.
LFarquaad
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Mar 10, 2019 2:24 pm
Contact:

Re: Keybinding issues

Post by LFarquaad »

posila wrote: Thu Mar 07, 2019 9:50 pm
beatryder wrote: Thu Mar 07, 2019 3:17 amI am unable to use any shortcut that uses my scroll wheel and it's made blueprints and copy/paste unusable.
What's your use case of scroll wheel that doesn't work in 0.17 and used to work in 0.16? Changes described in the first post are exclusive to keyboard presses (and maybe HW that emulates keyboard presses in some way)
You probably assigned a scroll movement to some other action. I had the same issue when I started playing the intro campaign (couldn't zoom out) and it took me a lot of time to figure out that it was assigned to undo (also causing other troubles…). The thing is… there is a scrollbar in the keybinding screen, and it could happen that you just intended to scroll the screen, but assigned scrolling (either direction) to a random action.

I think the UI would benefit from some improvements there: maybe rearrange it to avoid having a scrollbar, or show a confirmation dialog when you assign scroll/click/esc/delete/backspace/enter to a key.
LFarquaad
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Mar 10, 2019 2:24 pm
Contact:

Re: Keybinding issues

Post by LFarquaad »

Hello posila, I feel like my previous comment about the issue with copy/pasting has been unnoticed. Should I have reported it in a new topic? I had understood you wanted to track all such issues here:
posila wrote: Thu Feb 28, 2019 12:41 pm There are lot of report regarding to different keybinding issues. So I'd like to address them here in general to reduce number of duplicate threads.
posila
Factorio Staff
Factorio Staff
Posts: 5353
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Keybinding issues

Post by posila »

LFarquaad wrote: Thu Mar 14, 2019 11:59 pm Hello posila, I feel like my previous comment about the issue with copy/pasting has been unnoticed. Should I have reported it in a new topic? I had understood you wanted to track all such issues here:
posila wrote: Thu Feb 28, 2019 12:41 pm There are lot of report regarding to different keybinding issues. So I'd like to address them here in general to reduce number of duplicate threads.
No, it seems to be an issue of shortcuts not respecting your layout when typing into text boxes ... which is related to this topic.
m811
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Apr 08, 2016 11:20 pm
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by m811 »

I'm one of the people who remaps their Caps Lock to Control, too, and with v0.17 this is no longer honored. It wouldn't be such a big deal if one could reconfigure that in settings, but it seems Caps Lock isn't permitted as a modifier and therefore hitting "Caps+C" doesn't seem to register and just leaves "C" there.

(On Linux here and remapped Ctrl both via Xmodmap and xkbmap `ctrl:nocaps`)
Last edited by m811 on Sun Apr 07, 2019 1:56 am, edited 1 time in total.
User avatar
jamiechi1
Filter Inserter
Filter Inserter
Posts: 272
Joined: Wed Jan 03, 2018 10:12 pm

Re: Keybinding issues (when remapping keys in OS)

Post by jamiechi1 »

Most if not all problems people are having can be fixed by using Autohotkey. Because I have problems on my mouse using the middle mouse button, I was able to remap an unused key combination to the middle mouse button so I could use the new quickbar easier.

In doing that, I found that some of the default key mappings, such as 'm' for activating the map, prevent me from assigning Ctrl-m shift-m or Alt-m to anything else. Using them always brings up the map. Is this an intended result of the changes or a bug? (There are many more keys that are set up by default in Factorio that have this issue. We are running out of keys to use for our mods.)

(I, as some others have re-assigned the Alt key to the letter 'i' and more recently the mostly unused scroll lock key. I fail to see the logic in using a key that many of us have used for years as an alternate shift key for something totally different. Sorry for the rant.)
LFarquaad
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Mar 10, 2019 2:24 pm
Contact:

Re: Keybinding issues

Post by LFarquaad »

LFarquaad wrote: Sun Mar 10, 2019 3:12 pm I am a using the BÉPO keyboard layout, a Dvorak-inspired layout for French. I play on Ubuntu 18.10.

Today I wanted to use an external blueprint, but the usual keyboard shortcuts for pasting didn't work. I tried both CTRL+V and SHIFT+Insert.

I then tried CTRL+., which matches the QWERTY CTRL+V and it works… however it pastes the text TWICE – it took me a moment to understand why blueprints were not accepted (except one for some reason). Similarly, I can cut with CTRL+Y and copy with CTRL+X.
FYI, the issue is still present in 0.17.25. I also spent some time to check what happens on Windows. There the keyboard layout is not respected either for copy/paste in text boxes (one has to use CTRL+Y for cut, CTRL+X for copy and CTRL+. for paste as well), but the "double paste" issue is not present. I also checked with US-Dvorak layout and the behaviour is the same (use CTRL+QJK instead of XCV).
posila wrote: Fri Mar 15, 2019 10:37 am No, it seems to be an issue of shortcuts not respecting your layout when typing into text boxes ... which is related to this topic.
It seems though that this topic isn't getting much attention, whereas people posting separate similar bug reports actually get them fixed. So maybe this topic isn't the best way to track them?

(note that I can perfectly understand if those issues are not a priority, but it would be better to make it clear)
Claudius1729
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Apr 03, 2017 5:47 pm
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by Claudius1729 »

This issue is very annoying with trying to import bluestring.

As people have explained, for some reason, the shortcut for pasting blueprint strings requires you to use ctrl + ? where ? is the key v is mapped to into qwerty. This combineason is not the same than the paste combineason you can remap in the hotkeys.

There's apparently no way to re-map that key (the paste hotkey doesn't work).

I hope we get a fix soon.
posila
Factorio Staff
Factorio Staff
Posts: 5353
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by posila »

I am sorry for radio silence on this, the fixes required big changes and we were focusing mostly on crashes or bug reports that can be fixed quickly.

For 0.17.32:
Text boxes (and GUI in general) should fully respect keyboard layout (except for cases like 68809, it seems Windows translates scancodes to keycodes with latin characters, but Linux not ... so if we detect there is no scancode that would translate to keycode 'C', 'V', 'X', we use default US QWERTY mapping instead).

As for remapping modifier keys; if you swap keys (eg. you swap Ctrl and Caps Lock) it should work, if you map some non-modifier key as extra modifier (eg. you map Caps Lock as the third Control), it won't work.

As for escape remapping, we don't seem to have escape hardcoded anywhere anymore, everything seems to be handled by "Toggle Menu" control setting, so it should be possible to rebind it in game, I think?
BenSeidel
Filter Inserter
Filter Inserter
Posts: 590
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by BenSeidel »

Thank you!
Factorio has been unplayable without ctrl-caps swapping (literally... I can't bend my wrist in that way to get to the ctrl key without it hurting after 20 minutes). Can't wait to do a new play through!
thnarqo
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Sep 09, 2019 3:44 pm
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by thnarqo »

I use XKBOPTIONS="ctrl:nocaps" before which still doesn't work in the latest experimental factorio
However using XKBOPTIONS="ctrl:swapcaps" does now, as per the comment above about swapping control being supported but a third control key not being supported.
In an ideal world the keyboard shortcut window would still support using arbitrary scancodes including caps lock (0x66) as modifier keys so that people don't need to swap from nocaps to swapcaps every time they play factorio. Definitely an improvement that I can now use the caps lock key for control though.
dalindes
Burner Inserter
Burner Inserter
Posts: 18
Joined: Sun Jan 23, 2022 8:02 pm
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by dalindes »

posila wrote: Tue Apr 16, 2019 7:44 am As for remapping modifier keys; if you swap keys (eg. you swap Ctrl and Caps Lock) it should work, if you map some non-modifier key as extra modifier (eg. you map Caps Lock as the third Control), it won't work.
I'm glad I found this tidbit! Thanks for this info, posila. I'd mapped things to ctrl:nocaps, and the preferred control key was just being ignored... but based on the above, I changed it to ctrl:swapcaps, and now things work as expected. (I only wish I'd learned earlier, so I hadn't gotten somewhat used to reaching for that other key in Factorio -- which is now CapsLock, which doesn't help! :D)

I will just say that if there's some way to treat any control key as a control key, that'd be nifty... but, at least I'm able to use the key to the left of a (which is at the same spot in both QWERTY and Dvorak) as control now. Yay. :)
uukgoblin
Inserter
Inserter
Posts: 28
Joined: Mon Apr 02, 2018 4:43 pm
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by uukgoblin »

Issues to solve:

Handle remapped modifier keys.
and
if you map some non-modifier key as extra modifier (eg. you map Caps Lock as the third Control), it won't work.
So here we are, nearly 4 years after this issue was reported by the developers themselves after introducing it by themselves, and it's still not solved and not even a workaround is available :-(

When can we expect a fix, please? It used to work in 0.16.

A lot of people use `setxkbmap -option ctrl:nocaps`, it's practically a feature of Xorg to have this remapped.
uukgoblin
Inserter
Inserter
Posts: 28
Joined: Mon Apr 02, 2018 4:43 pm
Contact:

Re: Keybinding issues (when remapping keys in OS)

Post by uukgoblin »

If you really need to keep scan code processing, can we at least please have some config file option (or better yet, a menu item), to specify which scancodes are treated as which modifiers? I'm guessing the same issue will happen if someone remaps their Alt or Shift keys.
Post Reply

Return to “Resolved Problems and Bugs”