Keyboard layout under SDL

  • Phil Reynolds

    Phil Reynolds - 2012-03-25

    Under the GTK+ UI, I can quite happily switch keyboard layouts in my X session, and the keys picked up by fuse match the currently selected layout. I prefer a UK version of Dvorak, but some games have fixed keyboard layouts that are designed for QWERTY so I sometimes need to switch to that.

    Under SDL, it appears that, no matter which layout I have selected, the default for my session is used - at present this is the Dvorak layout. With a game that cannot be controlled by the joystick, this can result in awkward key layouts.

    Is there any way to get around this admittedly unusual problem?

  • Sergio Baldoví

    Sergio Baldoví - 2012-04-14

    I can switch the keyboard layout and fuse-sdl recognize it without any problems (Ubuntu 11.04, libsdl 1.2.14).

    You could try the following patch. Fix a problem with key presses in SDL UI, but honestly I think you have another problem.

    Maybe your best bet is redefining key mappings outside Fuse (caution!). E.g.,

    1. Use "xmodmap -pke > keymap.bak to backup your current settings
    2. Use "xev" to find keycodes by pressing keys. The XLookupString value should match your current layout.
    3. Modify the mappings for some keys:
      "keycode  10 = 1 exclam 1 exclam bar exclamdown 1 exclam onesuperior exclamdown"
      "keycode  11 = 2 quotedbl 2 quotedbl at oneeighth twosuperior NoSymbol 2 quotedbl twosuperior oneeighth"
    4. Restore your settings by applying your keyboard layout or manually with "xmodmap keymap.bak"


Log in to post a comment.