Re: [hatari-devel] alt-gr not recognized anymore with sdl2

[ Thread Index | Date Index | More Archives ]

Le 30/01/2016 17:37, Thomas Huth a écrit :

looks like your AltGr key also reports "ISO_Level3_Shift", just like
mine. However, after that patch that we've spotted in the other mail, it
seems like SDL2 only recognizes "RALT" if it is reported as "Alt_R" by
xev instead. I can fix the issue by applying the following patch to SDL2:

diff -r 9e8323b058d6 src/video/x11/SDL_x11keyboard.c
--- a/src/video/x11/SDL_x11keyboard.c   Thu May 28 12:48:20 2015 -0700
+++ b/src/video/x11/SDL_x11keyboard.c   Sat Jan 30 17:32:47 2016 +0100
@@ -128,6 +128,7 @@
      { XK_Control_R, SDL_SCANCODE_RCTRL },
      { XK_Shift_R, SDL_SCANCODE_RSHIFT },
      { XK_Alt_R, SDL_SCANCODE_RALT },
+    { XK_ISO_Level3_Shift, SDL_SCANCODE_RALT },
      { XK_Meta_R, SDL_SCANCODE_RGUI },
      { XK_Super_R, SDL_SCANCODE_RGUI },
      { XK_Mode_switch, SDL_SCANCODE_MODE },

Did you also compile SDL2 on your own? If yes, could you please check
whether this fixes the issue for you, too?


no I didn't compile it myself, that's the latest library built with my distro (I'm using Mageia cauldron, which includes all the latest libraries while mageia 6 is under development)

In my case, I see that mapping in /usr/share/X11/xkb/keycodes/evdev
        <LALT> = 64;
        <LCTL> = 37;
        <SPCE> = 65;
        <RCTL> = 105;
        <RALT> = 108;
        // Microsoft keyboard extra keys
        <LWIN> = 133;
        <RWIN> = 134;
        <COMP> = 135;
        alias <MENU> = <COMP>;
        alias <ALGR> = <RALT>;
	<LVL3> =   92;

92 is the keycode I get with alt-gt in xev, it seems that depending on the keyboard manufacturer the alt-gr key will not always have the same code (keycode to keyname conversion under X11 has always been a mess IMO, there's too many default mapping that never exactly matches each brand of keyboard, multimedia key are often broken)

Maybe your patch would be worth posting on SDL2 ML, having an extra alternative name for RALT should not be a bad thing.


Mail converted by MHonArc 2.6.19+