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

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On 26.01.2016 21:42, Nicolas Pomarède wrote:
> Le 26/01/2016 20:49, David Savinkoff a écrit :
>> ----- Nicolas Pomarède wrote:
>>> Le 18/01/2016 20:53, Thomas Huth a écrit :
>>>> On 17.01.2016 18:40, Nicolas Pomarède wrote:
>>>>> Hello
>>>>>
>>>>> it seems some of the recent changes broke alt-gr key under linux,
>>>>> when I
>>>>> use it I now get :
>>>>>
>>>>> Warning: Unhandled scancode 0xe6!
>>>>>
>>>>> so I'm unable to use shortcut + modifier
>>>>>
>>>>> It worked a few days ago with sdl2.
>>>>>
>>>>> If I recompile with sdl1, alt-gr works again.
>>>>
>>>> Sounds very strange, just like AltGr is not recognized as modifier but
>>>> only as a "normal" key instead. Did you change anything to your host
>>>> keyboard mapping? Does it work differntly when you change from scancode
>>>> mapping to symbolic mapping in the GUI? And what do you get when you
>>>> run
>>>> Hatari with "--trace keymap" ?
>>>
>>> Hi
>>>
>>> changing from scancode to sympbolic doesn't solve the problem ; no
>>> change were made too host mapping either (if I compile with SDL1,
>>> everything works as before with the same config).
>>>
>>> This is what --trace keymap gives :
>>>
>>> press alt-gr :
>>>
>>> key down: sym=1073741824 scan=230 mod=0x1000 name=''
>>> Warning: Unhandled scancode 0xe6!
>>> key map: sym=0x40000000 to ST-scan=0xff
>>>
>>> release alt-gr :
>>>
>>> key up: sym=1073741824 scan=230 mod=0x1000 name=''
>>> Warning: Unhandled scancode 0xe6!
>>>
>>> press F12 :
>>>
>>> key down: sym=1073741893 scan=69 mod=0x1000 name='F12'
>>>
>>>
>>> I have 2 linux PC with the same problem, but in both cases I had an
>>> update to the recent sdl 2.0.4 from early january (before I had 2.0.3).
>>> Maybe 2.0.4 broke sthg ? Can you try installing 2.0.4 to see if you get
>>> the same problem ?
>>
>> Alt-gr works for this version of SDL2, thus is good up to this point:
>> SDL.9893 (SDL2 pre 2.04 from HG) Oct. 11 2015
> 
> this could be a problem on my PCs, but alt-gr still works with SDL1
> version of Hatari. And if I use "xev" to see the reported codes, I get :
> 
> for right shift :
> 
> KeyPress event, serial 40, synthetic NO, window 0x3600001,
>     root 0x248, subw 0x3600002, time 44944509, (45,16), root:(1147,862),
>     state 0x10, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,
>     XLookupString gives 0 bytes:
>     XmbLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> 
> for alt gr :
> 
> KeyPress event, serial 40, synthetic NO, window 0x3600001,
>     root 0x248, subw 0x3600002, time 44955060, (45,16), root:(1147,862),
>     state 0x10, keycode 108 (keysym 0xfe03, ISO_Level3_Shift),
> same_screen YES,
>     XKeysymToKeycode returns keycode: 92
>     XLookupString gives 0 bytes:
>     XmbLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> So, I don't see any particular difference between these 2 keys at the
> X11 level, alt-gr has proper codes.

 Nicolas,

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?

 Thomas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/