Skip to content

Fixes non-QWERTY keyboards on Prison Architect (and maybe other SDL games) on Linux

License

Notifications You must be signed in to change notification settings

micolous/sdl-fakeqwerty

Repository files navigation

sdl-fakeqwerty

sdl-fakeqwerty makes your keyboard act like a US-QWERTY keyboard, while not changing any system settings. This is ideal for games with difficult or impossible to change keybindings which get messed up when using a non-US-QWERTY keyboard.

This library intercepts SDL's or Xlib's event system in order to rewrite the keysym to be what a US-QWERTY keyboard would return. When activated on a non-QWERTY keyboard, the game will have keyboard shortcuts with the same physical positions as a QWERTY keyboard. For example:

US-QWERTY US-Dvorak French AZERTY
(default settings) (with this library)
Q
Talk
W
Move forward
E
Use item
A
Move left
S
Move backward
D
Move right
'
Talk
,
Move forward
.
Use item
A
Move left
O
Move backward
E
Move right
A
Talk
Z
Move forward
E
Use item
Q
Move left
S
Move backward
D
Move right

This means you no longer have to change your keyboard layout to play a single game, and the remapping is isolated to a single application (window) and automated.

I've mainly tested this with some Introversion games. It might fix some other games as well -- it has been tested with Allegro, SDL 1.2, SDL 2.0 and Unity.

Key labels shown in-game will probably be displayed incorrectly as a result of using this library (they will be the same as a US-QWERTY keyboard).

Note: This will only work on Linux systems, as it relies on LD_PRELOAD to work. There is limited support on macOS (Prison Architect).

I'm not interested in porting this code to other platforms (eg: Windows), but patches are welcome if you can make it work. ;)

Documentation

About

Fixes non-QWERTY keyboards on Prison Architect (and maybe other SDL games) on Linux

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published