--- sourceforge.net/trunk/rdesktop/xkeymap.c 2003/01/28 12:27:28 297 +++ sourceforge.net/trunk/rdesktop/xkeymap.c 2003/02/18 13:44:27 331 @@ -20,7 +20,7 @@ #include #define XK_MISCELLANY -#include +#include #include #include #include @@ -34,6 +34,7 @@ extern Display *display; extern char keymapname[16]; extern int keylayout; +extern int win_button_size; extern BOOL enable_compose; static BOOL keymap_loaded; @@ -51,7 +52,7 @@ keysym = XStringToKeysym(keyname); if (keysym == NoSymbol) { - warning("Bad keysym %s in keymap %s\n", keyname, mapname); + DEBUG_KBD(("Bad keysym \"%s\" in keymap %s (ignoring)\n", keyname, mapname)); return; } @@ -198,7 +199,7 @@ /* Automatically add uppercase key, with same modifiers plus shift */ for (p = keyname; *p; p++) - *p = toupper(*p); + *p = toupper((int) *p); MASK_ADD_BITS(modifiers, MapLeftShiftMask); add_to_keymap(keyname, scancode, modifiers, mapname); } @@ -220,7 +221,7 @@ mapname_ptr = keymapname; while (*mapname_ptr) { - *mapname_ptr = tolower(*mapname_ptr); + *mapname_ptr = tolower((int) *mapname_ptr); mapname_ptr++; } @@ -307,6 +308,13 @@ rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL); } return True; + + case XK_space: + /* Prevent access to the Windows system menu in single app mode */ + if (win_button_size + && (get_key_state(state, XK_Alt_L) || get_key_state(state, XK_Alt_R))) + return True; + } return False; } @@ -423,6 +431,29 @@ break; } + /* NumLock */ + if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask) + != MASK_HAS_BITS(remote_modifier_state, MapNumLockMask)) + { + /* The remote modifier state is not correct */ + uint16 new_remote_state; + + if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)) + { + DEBUG_KBD(("Remote NumLock state is incorrect, activating NumLock.\n")); + new_remote_state = KBD_FLAG_NUMLOCK; + remote_modifier_state = MapNumLockMask; + } + else + { + DEBUG_KBD(("Remote NumLock state is incorrect, deactivating NumLock.\n")); + new_remote_state = 0; + remote_modifier_state = 0; + } + + rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, new_remote_state, 0); + } + /* Shift. Left shift and right shift are treated as equal; either is fine. */ if (MASK_HAS_BITS(tr.modifiers, MapShiftMask) != MASK_HAS_BITS(remote_modifier_state, MapShiftMask)) @@ -467,26 +498,7 @@ } } - /* NumLock */ - if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask) - != MASK_HAS_BITS(remote_modifier_state, MapNumLockMask)) - { - /* The remote modifier state is not correct */ - uint16 new_remote_state = 0; - - if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)) - { - DEBUG_KBD(("Remote NumLock state is incorrect, activating NumLock.\n")); - new_remote_state |= KBD_FLAG_NUMLOCK; - } - else - { - DEBUG_KBD(("Remote NumLock state is incorrect, deactivating NumLock.\n")); - } - rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, new_remote_state, 0); - update_modifier_state(SCANCODE_CHAR_NUMLOCK, True); - } }