I use the "Switch to US keyboard layout" in Lutris's options. But the layout changes for my entire Linux desktop too, until I quit the game. How can I have the US/qwerty layout just inside the game?

As someone who uses the Dvorak keyboard layout to type, I appreciate how Lutris’s “System Options” has “Switch to US keyboard layout” (i.e. qwerty).

This means I don’t have to do either of these two things:

  1. Remap the controls for every game.
  2. Temporarily change the keyboard layout to Qwerty in my Linux Mint’s keyboard settings every time i wanna play a game.

When I exit the game and return to my Linux Mint desktop, my layout automatically returns to my Dvorak layout (though it may take 5 seconds).

But here’s a problem I have. When I alt-tab out of a game and return to my Linux Mint desktop, everything is in qwerty. Is there a way for the Lutris “Switch to US keyboard (qwerty) layout” to apply only in the Lutris game, but still keep my original Dvorak when I’m back to Linux desktop?

1 Like

That is a lot of time, I think you should set a script yourself to switch keyboard layouts manually.
If you are using x11, to switch layouts you should be able to use something like this:

setxkbmap -layout de -variant deadtilde

Then Linux Mint for sure has a Hotkey system (Keyboar > Custom Shortcuts, according to google), so you can map to Ctrl+1 for Dvorak and Ctrl+2 for US layout.

Other than that there is no easier way to get this to work application specific.

thanks for your help @owohnzimmer on my several posts.
I’ll look into the Custom Shortcuts.

In the meanwhile, is there no way to get Lutris to “behave itself” and have the changed keyboard layout (the qwerty layout) apply only to games/programs it launches?

There are some ways to accomplish something like this; I saw a solution using “autokey” but these are not related to Lutris, are too complicated and might not work decently.

In linux mint 20.3 cinnamon’s Keyboard settings > Shortcuts tab, there’s a way to use a combo like Alt-Capslock to switch between layouts.

It doesn’t work when my Mint just has one layout: Dvorak. For Alt-Capslock to work I need to add qwerty into my Mint, but I don’t wish to do that.

Anyway, to experiment, I added “US English” (qwerty) as another layout.

For the following experiments, I turned off the “switch to US keyboard layout” in Lutris options.
A. While my Mint was in Dvorak, i started a game thru Lutris. I then pressed the Alt-Capslock combo but the game did not switch to Qwerty.

I tried something else.
B. While still in mint, I switched to Qwerty layout. (I set it up so that keyboard layout is global – all programs will have whatever layout you choose. In other words, once I made the change to Qwerty, it was qwerty in firofox, in text editor, and the search box in Lutris. I then launched the same game. But interestingly, it was still in Dvorak in the game.

I use autokey as a phrase expander. so i have a basic familiarity with it. But i do turn it off when playing games, to avoid auto expansions from being triggered.

Anyway, if my experiments with Mint’s Keyboard settings don’t work, I don’t think I should try with some other program.