Page 1 of 1

[0.13] Key bindings using parenleft key won't load properly

Posted: Mon Aug 08, 2016 7:06 pm
by vorku
In the "controls" tab, I have defined the key bindings for Quickbar 5 to "parenleft" and Quickbar 10 to "SHIFT + parenleft".

Whenever I start the game, these key binding do not work; however, if I go to the "controls" settings tab, the bindings are properly displayed; if I manually set those shortcuts to the current value, the keys will start working again.
The issue seems to be with the "parenleft" key: if I swap the keys for "quickbar 4" and "quickbar 5", the "parenleft" key still doesn't work.

Here is the relevant section of my config.ini; I'm running factorio 0.13.9 64 bits under Linux with a french (azerty) keyboard. The issue exists since at least 0.12.

Code: Select all

[controls]
editor-show-hard-difficulty=F11
editor-show-normal-difficulty=F10
editor-show-easy-difficulty=F9
editor-show-all-difficulties=F8
editor-edit-entity-details=t
editor-remove-entity=x
editor-tool-secondary-action=mouse-button-2
editor-tool-primary-action=mouse-button-1
cancel-craft-all=SHIFT + mouse-button-1
cancel-craft-5=mouse-button-2
cancel-craft=mouse-button-1
craft-all=SHIFT + mouse-button-1
craft-5=mouse-button-2
craft=mouse-button-1
toggle-console=twosuperior
smaller-terrain-building-area=KP_Subtract
larger-terrain-building-area=KP_Add
pause-game=SHIFT + space
disconnect-train=v
connect-train=g
confirm-message=Tab
toggle-map=m
production-statistics=p
toggle-menu=Escape
zoom-out=mouse-wheel-down
zoom-in=mouse-wheel-up
toggle-driving=Return
shoot-selected=c
shoot-enemy=space
pick-items=f
rotate=r
drop-cursor=w
clean-cursor=a
quickbar-10=SHIFT + parenleft
quickbar-9=SHIFT + apostrophe
quickbar-8=SHIFT + quotedbl
quickbar-7=SHIFT + eacute
quickbar-6=SHIFT + ampersand
clear-filter=CONTROL + mouse-button-3
fast-entity-split=CONTROL + mouse-button-2
inventory-split=CONTROL + mouse-button-2
stack-split=SHIFT + mouse-button-2
cursor-split=mouse-button-2
change-active-quickbar=x
quickbar-5=parenleft
quickbar-4=apostrophe
quickbar-3=quotedbl
quickbar-2=eacute
quickbar-1=ampersand
set-filter=mouse-button-3
fast-entity-transfer=CONTROL + mouse-button-1
inventory-transfer=CONTROL + mouse-button-1
stack-transfer=SHIFT + mouse-button-1
pick-item=mouse-button-1
next-weapon=less
show-info=Alt_L
open-gui=mouse-button-1
select-for-cancel-deconstruct=SHIFT + mouse-button-1
select-for-blueprint=mouse-button-1
paste-entity-settings=SHIFT + mouse-button-1
copy-entity-settings=SHIFT + mouse-button-2
remove-pole-cables=SHIFT + mouse-button-1
build-ghost=SHIFT + mouse-button-1
build=mouse-button-1
mine=mouse-button-2
close-gui=e
open-technology-gui=t
open-character-gui=e
move-down=s
move-left=q
move-right=d
move-up=z
toggle-filter=mouse-button-3
cycle-blueprint-forwards=SHIFT + mouse-wheel-up
cycle-blueprint-backwards=SHIFT + mouse-wheel-down
focus-search=CONTROL + f
drag-map=mouse-button-1

Re: [0.13] Key bindings using parenleft key won't load properly

Posted: Mon Aug 08, 2016 7:38 pm
by Loewchen
Doesn't parenleft already require the shift key to be pressed to type it?

Re: [0.13] Key bindings using parenleft key won't load properly

Posted: Mon Aug 08, 2016 8:39 pm
by vorku
Loewchen wrote:Doesn't parenleft already require the shift key to be pressed to type it?
Not on an azerty keyboard: the '(' is the normal key; 'SHIFT' is required to get a '5' — hence the layout I use.

Re: [0.13] Key bindings using parenleft key won't load properly

Posted: Tue Aug 09, 2016 4:04 pm
by Oxyd
When I switch to a French AZERTY keyboard and go to the controls setting, pressing the 5 key makes the control setting display a “5”. And, indeed, pressing it selects the 5th quickbar slot. Using that same key in the console produces a (, so Factorio does use the selected keyboard layout properly.

So, what else is needed to reproduce this? What distro are you using? Which desktop environment? How did you set your keyboard layout?

Re: [0.13] Key bindings using parenleft key won't load properly

Posted: Tue Aug 09, 2016 6:14 pm
by vorku
I'm running Gentoo, with a 4.1.12 kernel, using X 1.17.4; and running the standalone (non-steam) version of the game.

The keyboard is set through xorg.conf; but changing it with "setxkbmap fr" leads to the same results.

A xev snapshot of a keypress gives:

Code: Select all

% xev -event keyboard
Outer window is 0x4e00001, inner window is 0x4e00002
KeyPress event, serial 28, synthetic NO, window 0x4e00001,
    root 0x2a2, subw 0x0, time 2417490000, (152,-30), root:(945,280),
    state 0x10, keycode 14 (keysym 0x28, parenleft), same_screen YES,
    XLookupString gives 1 bytes: (28) "("
    XmbLookupString gives 1 bytes: (28) "("
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x4e00001,
    root 0x2a2, subw 0x0, time 2417490053, (152,-30), root:(945,280),
    state 0x10, keycode 14 (keysym 0x28, parenleft), same_screen YES,
    XLookupString gives 1 bytes: (28) "("
    XFilterEvent returns: False

I tried switching to a US layout and back (with "setxkbmap us"); the game behaved as expected with the US keymap (pressing the '5' key is detected properly, and kept across restarts).
However, when switching back to the FR layout, the issue came back.

To reproduce the issue, one has to:
- Set a french keymap ("setxkbmap fr")
- Start the game
- Define a shortcut as "parenleft" (through the controls menu)
- Confirm that the shortcut works
- Quit the game (the whole software)
- Start the game again
- Load a save / start a new game
- Confirm that the shortcut no longer works

xorg.conf:

Code: Select all

$ grep -A8 InputClass /etc/X11/xorg.conf.d/10_input.conf
Section "InputClass"
	Identifier  		"Keyboards"
        MatchIsKeyboard 	"yes"
        Option "XkbRules" 	"xorg"
        Option "XkbModel" 	"pc105"
        Option "XkbLayout" 	"fr"
        Option "XkbOptions" 	"compose:caps,terminate:ctrl_alt_bksp"
EndSection

Re: [0.13] Key bindings using parenleft key won't load properly

Posted: Thu Aug 11, 2016 4:38 pm
by Oxyd
Thanks for the detailed description. Fixed in 0.13.16.

Re: [0.13] Key bindings using parenleft key won't load properly

Posted: Sat Aug 13, 2016 10:04 am
by vorku
Awesome!!

Thanks a lot, you're all amazing :)