Great.
The reason I think a layout would be good is that it just remaps the keys at a low level, there’s nothing else in the way to mess things up.
What do you think you’d get from a script that you can’t get from this?
Bearing in mind that if global shortcuts work in the game we can script the layout change and probably check if the game is running. I can help with that too, but maybe not tonight (getting a little late).
Anyway I’ve done it now, so at least you have a workaround.
default
xkb_symbols "basic" {
include "de"
key <AD01> { [ u, U, at, Greek_OMEGA ] }; // q
key <AD02> { [ Up, Up, U017F, section ] }; // w
key <AC04> { [ d, D, dstroke, ordfeminine ] }; // f
key <AC01> { [ Left, Left, ae, AE ] }; // a
key <AC02> { [ Down, Down, U017F, U1E9E ] }; // s
key <AC03> { [ Right, Right, eth, ETH ] }; // d
key <AD03> { [ t, T, EuroSign, EuroSign ] }; // e
key <AB02> { [ KP_Insert, KP_0, guillemotleft, U2039 ] }; // x
key <AB03> { [ n, N, cent, copyright ] }; // c
};
You can save it as /usr/share/X11/xkb/symbols/custom
sudo nano /usr/share/X11/xkb/symbols/custom
# paste the layout above
# Ctrl + S to save and Ctrl + X to exit
and then add it in the same way you just did by selecting “A user defined custom layout” (I haven’t actually done this on KDE before but it’s the only option for a custom layout).
Then just switch with whatever key or combo you chose in “Switching to another layout”.
EDIT:
If you really want Enter to switch, I might be able to make two layouts and a script to switch between your normal layout and the other two. As in replace the German with a slightly modified version of the one above and a slightly modified version of German, for the duration of the game and then go back to the normal German.
Anyway if you’re willing, please test this, and we can talk about the rest.