ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.01k stars 198 forks source link

Differentiate between hardware key locations and key mappings #1508

Open Valentin-Metz opened 1 week ago

Valentin-Metz commented 1 week ago

I am using the German neo keyboard layout (while my physical keyboard is a normal German layout). If I launch a game without gamescope I get the following: The keybinds are mapped to the correct hardware buttons corresponding to a US layout. This allows me to play a game that has its movement keys mapped to WASD (pressing w on my keyboard makes me move forward): image

The typed text is still typed with the actual system keyboard layout though, so if I open chat, I can type with my system keyboard layout (so WASD typed into a chat field would result in VUIA). Pressing w on my keyboard types a v in chat: image This is great, because I can play any game without remapping keys (and games which do not support remapping), while being able to type normally.

Using gamescope breaks this differentiation between movement (or general control keys) and chat input. If I want to avoid remapping keys, I have to set XKB_DEFAULT_LAYOUT=us in order to control my character correctly. This however results in text being typed in an ingame chat window being typed on a US layout (so pressing w on my keyboard with chat open would type a w). If I set XKB_DEFAULT_LAYOUT=de XKB_DEFAULT_VARIANT=neo, I can type in chat with the correct layout, but my character controls are broken / would need to be remapped.

How do I regain the original behavior (as when running without gamescope) of games being able to treat hardware key locations and keyboard layout mappings differently?

Gibitwit commented 1 week ago

I would also appreciate this functionality.