change some magics to defines

master
Jay Sorg 8 years ago
parent 7a1a481ff9
commit c264862afe

@ -623,4 +623,10 @@
#define XRDP_MAX_BITMAP_CACHE_IDX 2000
#define XRDP_BITMAP_CACHE_ENTRIES 2048
#define XR_MIN_KEY_CODE 8
#define XR_MAX_KEY_CODE 256
#define XR_RDP_SCAN_LSHIFT 42
#define XR_RDP_SCAN_ALT 56
#endif

@ -273,7 +273,7 @@ xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self,
{
return 1;
}
in_uint16_le(s, code); /* keyCode (1 byte) */
in_uint16_le(s, code); /* unicode (2 byte) */
if (eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE)
{
flags |= KBD_FLAG_UP;

@ -1531,66 +1531,69 @@ xrdp_wm_key_unicode(struct xrdp_wm *self, int device_flags, int unicode)
{
int index;
for (index = 8; index < 256; index++)
for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
{
if (unicode == self->keymap.keys_noshift[index].chr)
{
xrdp_wm_key(self, device_flags, index - 8);
xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
return 0;
}
}
for (index = 8; index < 256; index++)
for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
{
if (unicode == self->keymap.keys_shift[index].chr)
{
if (device_flags & KBD_FLAG_UP)
{
xrdp_wm_key(self, device_flags, index - 8);
xrdp_wm_key(self, KBD_FLAG_UP, 42);
xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
xrdp_wm_key(self, KBD_FLAG_UP, XR_RDP_SCAN_LSHIFT);
}
else
{
xrdp_wm_key(self, KBD_FLAG_DOWN, 42);
xrdp_wm_key(self, device_flags, index - 8);
xrdp_wm_key(self, KBD_FLAG_DOWN, XR_RDP_SCAN_LSHIFT);
xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
}
return 0;
}
}
for (index = 8; index < 256; index++)
for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
{
if (unicode == self->keymap.keys_altgr[index].chr)
{
if (device_flags & KBD_FLAG_UP)
{
xrdp_wm_key(self, device_flags, index - 8);
xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT, 56);
xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT,
XR_RDP_SCAN_ALT);
}
else
{
xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT, 56);
xrdp_wm_key(self, device_flags, index - 8);
xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT,
XR_RDP_SCAN_ALT);
xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
}
return 0;
}
}
for (index = 8; index < 256; index++)
for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
{
if (unicode == self->keymap.keys_shiftaltgr[index].chr)
{
if (device_flags & KBD_FLAG_UP)
{
xrdp_wm_key(self, device_flags, index - 8);
xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT, 56);
xrdp_wm_key(self, KBD_FLAG_UP, 42);
xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT, XR_RDP_SCAN_ALT);
xrdp_wm_key(self, KBD_FLAG_UP, XR_RDP_SCAN_LSHIFT);
}
else
{
xrdp_wm_key(self, KBD_FLAG_DOWN, 42);
xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT, 56);
xrdp_wm_key(self, device_flags, index - 8);
xrdp_wm_key(self, KBD_FLAG_DOWN, XR_RDP_SCAN_LSHIFT);
xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT,
XR_RDP_SCAN_ALT);
xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
}
return 0;
}

Loading…
Cancel
Save