Meta, Alt, Super: key mapping problems

Hendrik Tews H.Tews "at" cs.ru.nl
Fri Mar 9 09:55:01 2007


Hi,

I configured my keyboard to have real and independent Alt, Meta,
and Super keys. Inside a vnc viewer only Alt works. The Meta key
generates some nonsensical Shift events and for the Super key the
modifier bits are lost (details below). There is no xmodmap
running on the vnc X server.

What do I have to do to make keys inside vnc behave the same as
outside? What I want is simply that a key that generates a Meta_L
keysym with modifier bits 0x40 outside vnc does generate the same
keysym inside vnc.

I tried  -RemapKeys '0xffe7->0xffe7' (Meta_L is 0xffe7) but it
doesn't have any effect.

There have been discussions about this problem before (mostly
xmodmap related) however, I couldn't find any solution.



key events outside vnc (logged by xev running on the real screen)
==========================================================================

left Alt key:

KeyPress event, serial 30, synthetic NO, window 0x2e00001,
    root 0x63, subw 0x0, time 904754106, (134,16), root:(934,384),
    state 0x0, keycode 115 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x2e00001,
    root 0x63, subw 0x0, time 904754202, (134,16), root:(934,384),
    state 0x8, keycode 115 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 


left meta key:

KeyPress event, serial 33, synthetic NO, window 0x2e00001,
    root 0x63, subw 0x0, time 904763346, (134,16), root:(934,384),
    state 0x0, keycode 64 (keysym 0xffe7, Meta_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x2e00001,
    root 0x63, subw 0x0, time 904763474, (134,16), root:(934,384),
    state 0x40, keycode 64 (keysym 0xffe7, Meta_L), same_screen YES,
    XLookupString gives 0 bytes: 


right super key:

KeyPress event, serial 33, synthetic NO, window 0x2e00001,
    root 0x63, subw 0x0, time 904770209, (134,16), root:(934,384),
    state 0x0, keycode 117 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x2e00001,
    root 0x63, subw 0x0, time 904770289, (134,16), root:(934,384),
    state 0x20, keycode 117 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes: 



key events inside vnc (logged by xev running on the virtual desktop)
==========================================================================

Alt key:

KeyPress event, serial 29, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907210128, (146,88), root:(153,111),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 31, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907210215, (146,88), root:(153,111),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 

for alt everything is fine: right keysym, right modifier flags


Meta key:

KeyPress event, serial 31, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907210767, (146,88), root:(153,111),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 31, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907210768, (146,88), root:(153,111),
    state 0x1, keycode 64 (keysym 0xffe7, Meta_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 31, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907210768, (146,88), root:(153,111),
    state 0x9, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 

KeyRelease event, serial 31, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907210831, (146,88), root:(153,111),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 

This is completely nonsensical! Where does the shift event
comming from? Why do I have the shift modifier flag? Why do
keypress and keyrelease events differ??



Syper key:

KeyPress event, serial 31, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907211807, (146,88), root:(153,111),
    state 0x0, keycode 255 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 31, synthetic NO, window 0x600001,
    root 0x2e, subw 0x0, time 907211863, (146,88), root:(153,111),
    state 0x0, keycode 255 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes: 

Almost working, only the modifier bits are lost (note the state
0x20 for super on the real screen). This could actuall be fixed
with xmodmap.


Bye,

Hendrik