Bug 168015 - AltGr does not send correct key codes
Summary: AltGr does not send correct key codes
Status: RESOLVED FIXED
Alias: None
Product: krdc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-01 18:02 UTC by Guillaume Pothier
Modified: 2008-08-06 13:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fixes situations were the Alt key is not released (909 bytes, patch)
2008-08-06 01:26 UTC, Guillaume Pothier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Pothier 2008-08-01 18:02:56 UTC
Version:           trunk (using Devel)
Installed from:    Compiled sources
OS:                Linux

I am connecting to an Ubuntu desktop (vnc server is vnc4server) from a kubuntu desktop, using krdc compiled this week from trunk.
I have a spanish keyboard.
No key combinations involving AltGr are correctly passed to the remote desktop.
Here is the (incorrect) output of xev on the remote machine when I try to input a curly brace:
8<------------------
KeyPress event, serial 27, synthetic NO, window 0x3000001,
   root 0x25, subw 0x0, time 2128842945, (39,-18), root:(985,297),
   state 0x0, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
   XLookupString gives 0 bytes:
   XmbLookupString gives 0 bytes:
   XFilterEvent returns: False

KeyPress event, serial 27, synthetic NO, window 0x3000001,
   root 0x25, subw 0x0, time 2128843713, (39,-18), root:(985,297),
   state 0x8, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
   XLookupString gives 0 bytes:
   XmbLookupString gives 0 bytes:
   XFilterEvent returns: False

KeyPress event, serial 27, synthetic NO, window 0x3000001,
   root 0x25, subw 0x0, time 2128843713, (39,-18), root:(985,297),
   state 0x9, keycode 34 (keysym 0x7b, braceleft), same_screen YES,
   XLookupString gives 1 bytes: (7b) "{"
   XmbLookupString gives 1 bytes: (7b) "{"
   XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x3000001,
   root 0x25, subw 0x0, time 2128843713, (39,-18), root:(985,297),
   state 0x9, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
   XLookupString gives 0 bytes:
   XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x3000001,
   root 0x25, subw 0x0, time 2128843785, (39,-18), root:(985,297),
   state 0x8, keycode 34 (keysym 0x5b, bracketleft), same_screen YES,
   XLookupString gives 1 bytes: (5b) "["
   XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x3000001,
   root 0x25, subw 0x0, time 2128844319, (39,-18), root:(985,297),
   state 0x8, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
   XLookupString gives 0 bytes:
   XFilterEvent returns: False
8<------------------

Here is the (correct) xev output on the local machine:
8<------------------
KeyPress event, serial 28, synthetic NO, window 0x4a00001,
    root 0x5a, subw 0x0, time 224305488, (70,-15), root:(75,641),
    state 0x10, keycode 113 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XLookupString gives 0 bytes:                                               
    XmbLookupString gives 0 bytes:                                             
    XFilterEvent returns: False                                                

KeyPress event, serial 31, synthetic NO, window 0x4a00001,
    root 0x5a, subw 0x0, time 224306016, (70,-15), root:(75,641),
    state 0x90, keycode 48 (keysym 0x7b, braceleft), same_screen YES,
    XKeysymToKeycode returns keycode: 16                             
    XLookupString gives 1 bytes: (7b) "{"                            
    XmbLookupString gives 1 bytes: (7b) "{"                          
    XFilterEvent returns: False                                      

KeyRelease event, serial 31, synthetic NO, window 0x4a00001,
    root 0x5a, subw 0x0, time 224306136, (70,-15), root:(75,641),
    state 0x90, keycode 48 (keysym 0x7b, braceleft), same_screen YES,
    XKeysymToKeycode returns keycode: 16                             
    XLookupString gives 1 bytes: (7b) "{"                            
    XFilterEvent returns: False                                      

KeyRelease event, serial 31, synthetic NO, window 0x4a00001,
    root 0x5a, subw 0x0, time 224306728, (70,-15), root:(75,641),
    state 0x90, keycode 113 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XLookupString gives 0 bytes:                                               
    XFilterEvent returns: False                                                
8<------------------
Comment 1 Guillaume Pothier 2008-08-02 02:12:04 UTC
Another combination that doesn't work: Ctrl+Shift+T (it seems to be the same with any Ctrl+Shift combo). Here is the output of xev:
KeyPress event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159861246, (487,385), root:(492,434),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159863006, (487,385), root:(492,434),
    state 0x4, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159863430, (487,385), root:(492,434),
    state 0x5, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159863430, (487,385), root:(492,434),
    state 0x4, keycode 28 (keysym 0x74, t), same_screen YES,
    XLookupString gives 1 bytes: (14) ""
    XmbLookupString gives 1 bytes: (14) ""
    XFilterEvent returns: False

KeyPress event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159863430, (487,385), root:(492,434),
    state 0x4, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159863502, (487,385), root:(492,434),
    state 0x5, keycode 28 (keysym 0x54, T), same_screen YES,
    XLookupString gives 1 bytes: (14) ""
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159863585, (487,385), root:(492,434),
    state 0x5, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x200001,
    root 0x25, subw 0x0, time 2159863641, (487,385), root:(492,434),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Comment 2 Guillaume Pothier 2008-08-02 02:16:52 UTC
And yet another one: Ctrl+any number key (not keypad, those above the letters). Xev output:
KeyPress event, serial 27, synthetic NO, window 0x3000001,
    root 0x25, subw 0x0, time 2160200806, (296,197), root:(301,246),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 27, synthetic NO, window 0x3000001,
    root 0x25, subw 0x0, time 2160201101, (296,197), root:(301,246),
    state 0x4, keycode 49 (keysym 0x60, grave), same_screen YES,
    XLookupString gives 1 bytes: (00) ""
    XmbLookupString gives 1 bytes: (00) ""
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x3000001,
    root 0x25, subw 0x0, time 2160201173, (296,197), root:(301,246),
    state 0x4, keycode 49 (keysym 0x60, grave), same_screen YES,
    XLookupString gives 1 bytes: (00) ""
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x3000001,
    root 0x25, subw 0x0, time 2160201252, (296,197), root:(301,246),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

The correct keysym for the number key (2 in this case) is "0x32, 2" not "0x60, grave"
Comment 3 Urs Wolfer 2008-08-02 16:25:11 UTC
SVN commit 841060 by uwolfer:

Correctely respect key modifiers in VNC.
Patch by Guillaume Pothier, thanks a lot!
BUG:168015
BUG:162865
(#162865: fixes KDE 4 issues, other issues listed there are already fixed in KDE 4)

 M  +39 -10    vncview.cpp  
 M  +1 -0      vncview.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=841060
Comment 4 Urs Wolfer 2008-08-02 16:26:55 UTC
SVN commit 841061 by uwolfer:

Backport:
SVN commit 841060 by uwolfer:

Correctely respect key modifiers in VNC.
Patch by Guillaume Pothier, thanks a lot!
CCBUG:168015
CCBUG:162865
(#162865: fixes KDE 4 issues, other issues listed there are already fixed in KDE 4)

 M  +39 -10    vncview.cpp  
 M  +1 -0      vncview.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=841061
Comment 5 Guillaume Pothier 2008-08-06 01:26:22 UTC
Created attachment 26677 [details]
Fixes situations were the Alt key is not released

When the shift key is pressed, the key event corresponding to pressing the Alt
key actually has the Meta symcode. This patch checks this condition and sends
Alt instead.
Comment 6 Urs Wolfer 2008-08-06 13:40:16 UTC
SVN commit 843074 by uwolfer:

Fixes situations were the Alt key is not released.
Patch by Guillaume Pothier, thanks.
CCBUG:168015
CCMAIL:gpothier@gmail.com

 M  +4 -1      vncview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=843074
Comment 7 Urs Wolfer 2008-08-06 13:41:10 UTC
SVN commit 843075 by uwolfer:

Backport:
SVN commit 843074 by uwolfer:

Fixes situations were the Alt key is not released.
Patch by Guillaume Pothier, thanks.
CCBUG:168015

 M  +4 -1      vncview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=843075