diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2016-12-10 01:06:45 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2016-12-10 01:06:45 -0800 |
commit | c264862afe5ef3b21f0774bc108782fbc68bede3 (patch) | |
tree | 21b02d70bbec46640ff858d0edd8aff857acab31 /xrdp | |
parent | 7a1a481ff997d64028de6f0cdc5ab6b42b28f91d (diff) | |
download | xrdp-proprietary-c264862afe5ef3b21f0774bc108782fbc68bede3.tar.gz xrdp-proprietary-c264862afe5ef3b21f0774bc108782fbc68bede3.zip |
change some magics to defines
Diffstat (limited to 'xrdp')
-rw-r--r-- | xrdp/xrdp_wm.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 26d488ec..446939bc 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -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; } |