Only release Shift if non-physical shift plus Ctrl is pressed;

not if CapsLock is active. This should solve bug 1228691.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1217 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2006-04-07 22:17:14 +00:00
parent c05dbc98b1
commit ffb111b2a1

View File

@ -629,13 +629,18 @@ xkeymap_translate_key(uint32 keysym, unsigned int keycode, unsigned int state)
} }
} }
if ((tr.modifiers & MapLeftShiftMask) /* Windows interprets CapsLock+Ctrl+key
&& ((remote_modifier_state & MapLeftCtrlMask) differently from Shift+Ctrl+key. Since we
|| (remote_modifier_state & MapRightCtrlMask)) are simulating CapsLock with Shifts, things
&& get_key_state(state, XK_Caps_Lock)) like Ctrl+f with CapsLock on breaks. To
solve this, we are releasing Shift if Ctrl
is on, but only if Shift isn't physically pressed. */
if (MASK_HAS_BITS(tr.modifiers, MapShiftMask)
&& MASK_HAS_BITS(remote_modifier_state, MapCtrlMask)
&& !MASK_HAS_BITS(state, ShiftMask))
{ {
DEBUG_KBD(("CapsLock + Ctrl pressed, releasing LeftShift\n")); DEBUG_KBD(("Non-physical Shift + Ctrl pressed, releasing Shift\n"));
tr.modifiers ^= MapLeftShiftMask; MASK_REMOVE_BITS(tr.modifiers, MapShiftMask);
} }
DEBUG_KBD(("Found scancode translation, scancode=0x%x, modifiers=0x%x\n", DEBUG_KBD(("Found scancode translation, scancode=0x%x, modifiers=0x%x\n",