Shift optimization: Either left or right shift is fine.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@182 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
b9eeaf747d
commit
16122cf6f6
26
xkeymap.c
26
xkeymap.c
@ -25,6 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <assert.h>
|
||||||
#include "rdesktop.h"
|
#include "rdesktop.h"
|
||||||
#include "scancodes.h"
|
#include "scancodes.h"
|
||||||
|
|
||||||
@ -362,21 +363,34 @@ ensure_remote_modifiers(uint32 ev_time, key_translation tr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shift */
|
/* Shift. Left shift and right shift are treated as equal; either is fine. */
|
||||||
if (MASK_HAS_BITS(tr.modifiers, MapShiftMask)
|
if (MASK_HAS_BITS(tr.modifiers, MapShiftMask)
|
||||||
!= MASK_HAS_BITS(remote_modifier_state, MapShiftMask))
|
!= MASK_HAS_BITS(remote_modifier_state, MapShiftMask))
|
||||||
{
|
{
|
||||||
/* The remote modifier state is not correct */
|
/* The remote modifier state is not correct */
|
||||||
if (MASK_HAS_BITS(tr.modifiers, MapShiftMask))
|
if (MASK_HAS_BITS(tr.modifiers, MapLeftShiftMask))
|
||||||
{
|
{
|
||||||
/* Needs this modifier. Send down. */
|
/* Needs left shift. Send down. */
|
||||||
rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_LSHIFT);
|
rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_LSHIFT);
|
||||||
}
|
}
|
||||||
|
else if (MASK_HAS_BITS(tr.modifiers, MapRightShiftMask))
|
||||||
|
{
|
||||||
|
/* Needs right shift. Send down. */
|
||||||
|
rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_RSHIFT);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Should not use this modifier. Send up. */
|
/* Should not use this modifier. Send up for shift currently pressed. */
|
||||||
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);
|
if (MASK_HAS_BITS(remote_modifier_state, MapLeftShiftMask))
|
||||||
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);
|
/* Left shift is down */
|
||||||
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
assert(MASK_HAS_BITS(remote_modifier_state, MapRightShiftMask));
|
||||||
|
/* Right shift is down */
|
||||||
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user