Page 1 of 1

[0.17.2] System-wide rebound escape key doesn't exit menus

Posted: Thu Feb 28, 2019 5:21 pm
by Xiretza
I use the "caps:swapescape" Xkb option, which basically switches the functions of the capslock and escape keys system-wide (well, in the X session). This is quite useful in a lot of applications that require frequent escape key presses (like vim or factorio) because it makes it much easier to reach. It has never been a problem until now, since the keycode remapping is transparent to factorio.

Unfortunately, 0.17 started using scan codes instead of key codes, which kind of breaks this setup: as previously reported (viewtopic.php?t=53595), "Toggle menu" keybindings other than escape are not properly supported.
Specifically, my escape (physical capslock) key no longer closes the pause menu, and no longer backs out of main menus (such as "Play" or "Settings"). This was reported as "problem 2" in the linked thread. I'm assuming it's a problem for me now because pressing the physical capslock key sends out an escape keysym and a capslock scancode, and factorio now looks at the latter.

Pausing the game and closing out of the other kind of menu ("About", "New Game") works fine, probably because they honor the "Toggle menu" keybind (which is set to the capslock scan code).

It would be amazing if the main menu family (like the pause menu) could also get support for "Toggle menu" scan codes other than escape.

Re: [0.17.2] System-wide rebound escape key doesn't exit menus

Posted: Thu Feb 28, 2019 6:10 pm
by Risce
See viewtopic.php?f=7&t=65881 (dev post on key remapping) and viewtopic.php?f=7&t=65402 (related / same issue)

Re: [0.17.2] System-wide rebound escape key doesn't exit menus

Posted: Thu Feb 28, 2019 6:12 pm
by Xiretza
I was just about to say it's probably a dupe of viewtopic.php?t=65402 that exact second, sorry ;)