Page 1 of 1

[0.16.50] AltGr keybinding acting totally weird

Posted: Fri Jun 15, 2018 1:18 pm
by SuperSandro2000
When I change a control to the AltGr key it only works if I press AltGr and then Ctrl or Alt in that order or if I press Alt and then Ctrl.

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Thu Jun 28, 2018 7:08 pm
by mexmer
What keyboard layout you use, some keyboard layouts treat altgrvdifferent 2ay (like prefix key), some make no difference between alt and altgr.

Also your os, and (if it’s linux), your window manager

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Sat Jun 30, 2018 6:26 am
by SuperSandro2000
mexmer wrote:What keyboard layout you use, some keyboard layouts treat altgrvdifferent 2ay (like prefix key), some make no difference between alt and altgr.

Also your os, and (if it’s linux), your window manager
German keyboard layout Windows 10 and Ctrl + Alt should equal AltGr and not some weird combining of both.

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Sat Jun 30, 2018 1:35 pm
by Rseding91
Thanks for the report. Input handling is changing in 0.17 with the re-work of the graphics backend so this may be solved for 0.17.

Regarding your current issue: can you verify that when you press the key on your keyboard it produces a distinct scan code over the left alt key?

If it's doing what I think it's doing then it's simply not going to work. That is: if it's not producing its own scan code and just sending shift + ctrl at the same time when pressed.

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Sat Jun 30, 2018 1:54 pm
by eradicator
Just for reference, on my german keyboard pressing e.g. AltGr+R produces (Windows 8):

Code: Select all

VK  SC	Type	Up/Dn	Elapsed	Key
-----------------------------------
#AltGr+R
A2  01D	 	d	0.56	LControl       	
A5  138	 	d	0.02	RAlt           	
52  013	 	d	0.09	R              	
52  013	 	u	0.16	R              	
A2  01D	 	u	0.06	LControl       	
A5  138	 	u	0.00	RAlt           	      	
#LControl+LAlt+R
A2  01D	 	d	0.44	LControl       	
A4  038	#	d	0.05	LAlt           	
52  013	 	d	0.38	R              	
A2  01D	 	u	0.19	LControl       	
A4  038	 	u	0.00	LAlt           	
52  013	 	u	0.00	R   
The keyboard has a seperate RControl, but no seperate RAlt key. If i assign the above to reverse-rotate it works fine in-game, but pressing LControl+LAlt+R (or RControl+LAlt+R) does too, so the game makes no differece between R/L variants?

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Sat Jun 30, 2018 3:26 pm
by Rseding91
eradicator wrote:The keyboard has a seperate RControl, but no seperate RAlt key. If i assign the above to reverse-rotate it works fine in-game, but pressing LControl+LAlt+R (or RControl+LAlt+R) does too, so the game makes no differece between R/L variants?
Sounds plausable. The game makes no distinction between enter and numpad enter either because they're not useful distinctions to the game. I've personally never seen a keyboard with "AltGr" (all of my US keyboards just say "Alt" on both alt keys).

Possibly the only way to make this work for everyone is to add some option to make the game treat left/right variants of keys as distinct. First we would have to go through the code base and make sure everything that wanted to listen to "alt" listened to both or a specific one if it meant a specific one.

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Sat Jun 30, 2018 4:41 pm
by eradicator
Rseding91 wrote:I've personally never seen a keyboard with "AltGr" (all of my US keyboards just say "Alt" on both alt keys).
I don't think i've ever seen one without :D. Not inside of Germany anyway. (Due to that my muscle memory considers them inheritely different. I think shift is the only key i consider "the same" for R/L, but even RCtrl i don't consider "the same" as LCtrl and would thus never try to substitude one for the other when typing.)
According to wiki there's a few other countries (including US) that have layouts with AltGr https://en.wikipedia.org/wiki/AltGr#German. Out of curiosity: Do the RAlts on your keyboards actually only trigger RAlt, or does the keyboard driver make them into AltGr but you never noticed?
Rseding91 wrote: Possibly the only way to make this work for everyone is to add some option to make the game treat left/right variants of keys as distinct. First we would have to go through the code base and make sure everything that wanted to listen to "alt" listened to both or a specific one if it meant a specific one.
I wonder how other games handle that. My perception is too biased to tell if anyone would be bothered by RCtrl/RAlt being "different" keys.

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Sun Jul 01, 2018 9:17 am
by steinio
In Farming Simulator the are different keys because you need a lot of them.

Re: [0.16.50] AltGr keybinding acting totally weird

Posted: Wed Jul 04, 2018 7:41 am
by SuperSandro2000
Rseding91 wrote:
eradicator wrote:The keyboard has a seperate RControl, but no seperate RAlt key. If i assign the above to reverse-rotate it works fine in-game, but pressing LControl+LAlt+R (or RControl+LAlt+R) does too, so the game makes no differece between R/L variants?
Sounds plausable. The game makes no distinction between enter and numpad enter either because they're not useful distinctions to the game. I've personally never seen a keyboard with "AltGr" (all of my US keyboards just say "Alt" on both alt keys).

Possibly the only way to make this work for everyone is to add some option to make the game treat left/right variants of keys as distinct. First we would have to go through the code base and make sure everything that wanted to listen to "alt" listened to both or a specific one if it meant a specific one.
Most things I know even treat all numpad keys and both mirrored keys differently. I would suggest to differentiate all keys from one another.