2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
User interface services - X keyboard mapping |
User interface services - X keyboard mapping |
4 |
|
|
5 |
Copyright (C) Matthew Chapman 1999-2002 |
Copyright (C) Matthew Chapman 1999-2005 |
6 |
Copyright (C) Peter Astrand <peter@cendio.se> 2003 |
Copyright (C) Peter Astrand <peter@cendio.se> 2003 |
7 |
|
|
8 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
40 |
extern Display *g_display; |
extern Display *g_display; |
41 |
extern Window g_wnd; |
extern Window g_wnd; |
42 |
extern char keymapname[16]; |
extern char keymapname[16]; |
43 |
extern int keylayout; |
extern int g_keylayout; |
44 |
extern int g_win_button_size; |
extern int g_win_button_size; |
45 |
extern BOOL g_enable_compose; |
extern BOOL g_enable_compose; |
46 |
extern BOOL g_use_rdp5; |
extern BOOL g_use_rdp5; |
137 |
/* map */ |
/* map */ |
138 |
if (strncmp(line, "map ", 4) == 0) |
if (strncmp(line, "map ", 4) == 0) |
139 |
{ |
{ |
140 |
keylayout = strtol(line + 4, NULL, 16); |
g_keylayout = strtol(line + 4, NULL, 16); |
141 |
DEBUG_KBD(("Keylayout 0x%x\n", keylayout)); |
DEBUG_KBD(("Keylayout 0x%x\n", g_keylayout)); |
142 |
continue; |
continue; |
143 |
} |
} |
144 |
|
|
408 |
} |
} |
409 |
} |
} |
410 |
|
|
411 |
|
if ((tr.modifiers & MapLeftShiftMask) && ((remote_modifier_state & MapLeftCtrlMask) |
412 |
|
|| (remote_modifier_state & MapRightCtrlMask)) |
413 |
|
&& get_key_state(state, XK_Caps_Lock)) |
414 |
|
{ |
415 |
|
DEBUG_KBD(("CapsLock + Ctrl pressed, releasing LeftShift\n")); |
416 |
|
tr.modifiers ^= MapLeftShiftMask; |
417 |
|
} |
418 |
|
|
419 |
if (tr.scancode != 0) |
if (tr.scancode != 0) |
420 |
{ |
{ |
421 |
DEBUG_KBD(("Found key translation, scancode=0x%x, modifiers=0x%x\n", |
DEBUG_KBD(("Found key translation, scancode=0x%x, modifiers=0x%x\n", |
664 |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT); |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT); |
665 |
|
|
666 |
if (MASK_HAS_BITS(remote_modifier_state, MapRightAltMask) && |
if (MASK_HAS_BITS(remote_modifier_state, MapRightAltMask) && |
667 |
!get_key_state(state, XK_Alt_R) && !get_key_state(state, XK_Mode_switch) && !get_key_state(state, XK_ISO_Level3_Shift)) |
!get_key_state(state, XK_Alt_R) && !get_key_state(state, XK_Mode_switch) |
668 |
|
&& !get_key_state(state, XK_ISO_Level3_Shift)) |
669 |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT); |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT); |
670 |
|
|
671 |
reset_winkey(ev_time); |
reset_winkey(ev_time); |