https://github.com/micolous/sdl-fakeqwerty
Fixes non-QWERTY keyboards on Prison Architect (and maybe other SDL games) on Linux
https://github.com/micolous/sdl-fakeqwerty
game keyboard ldpreload sdl sdl2 xlib
Last synced: 5 months ago
JSON representation
Fixes non-QWERTY keyboards on Prison Architect (and maybe other SDL games) on Linux
- Host: GitHub
- URL: https://github.com/micolous/sdl-fakeqwerty
- Owner: micolous
- License: other
- Created: 2017-03-18T12:08:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-17T23:01:49.000Z (almost 6 years ago)
- Last Synced: 2025-06-12T01:45:10.645Z (5 months ago)
- Topics: game, keyboard, ldpreload, sdl, sdl2, xlib
- Language: C
- Size: 56.6 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING-sdl1.2.txt
Awesome Lists containing this project
README
# 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][background].
This library intercepts SDL's or Xlib's event system in order to rewrite
[the `keysym`][background] 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
* [Building this library](./building.md)
* [Games list](./games/README.md)
* [License agreement](./COPYING.md)
[background]: ./background.md