--- sourceforge.net/trunk/rdesktop/xkeymap.c 2003/01/28 12:27:28 297 +++ sourceforge.net/trunk/rdesktop/xkeymap.c 2003/02/12 09:56:13 326 @@ -51,7 +51,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 +198,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 +220,7 @@ mapname_ptr = keymapname; while (*mapname_ptr) { - *mapname_ptr = tolower(*mapname_ptr); + *mapname_ptr = tolower((int) *mapname_ptr); mapname_ptr++; } @@ -423,6 +423,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 +490,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); - } }