diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2016-12-10 00:11:28 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2016-12-10 00:11:28 -0800 |
commit | 2f8d3ba9da68c120a5a4f156a0da06c135b9e862 (patch) | |
tree | 1b22111188894eaa0526fe54d0ec463ef27df4e8 /xrdp/xrdp_wm.c | |
parent | 42272c0f1891264af718e8f0a02ebc883f248ed8 (diff) | |
download | xrdp-proprietary-2f8d3ba9da68c120a5a4f156a0da06c135b9e862.tar.gz xrdp-proprietary-2f8d3ba9da68c120a5a4f156a0da06c135b9e862.zip |
add unicode support
Diffstat (limited to 'xrdp/xrdp_wm.c')
-rw-r--r-- | xrdp/xrdp_wm.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 4917c3aa..26d488ec 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -1527,6 +1527,80 @@ xrdp_wm_key_sync(struct xrdp_wm *self, int device_flags, int key_flags) /*****************************************************************************/ int APP_CC +xrdp_wm_key_unicode(struct xrdp_wm *self, int device_flags, int unicode) +{ + int index; + + for (index = 8; index < 256; index++) + { + if (unicode == self->keymap.keys_noshift[index].chr) + { + xrdp_wm_key(self, device_flags, index - 8); + return 0; + } + } + + for (index = 8; index < 256; 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); + } + else + { + xrdp_wm_key(self, KBD_FLAG_DOWN, 42); + xrdp_wm_key(self, device_flags, index - 8); + } + return 0; + } + } + + for (index = 8; index < 256; 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); + } + else + { + xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT, 56); + xrdp_wm_key(self, device_flags, index - 8); + } + return 0; + } + } + + for (index = 8; index < 256; 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); + } + 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); + } + return 0; + } + } + + return 0; +} + +/*****************************************************************************/ +int APP_CC xrdp_wm_pu(struct xrdp_wm *self, struct xrdp_bitmap *control) { int x; @@ -1721,6 +1795,9 @@ callback(long id, int msg, long param1, long param2, long param3, long param4) case 4: /* RDP_INPUT_SCANCODE */ rv = xrdp_wm_key(wm, param3, param1); break; + case 5: /* RDP_INPUT_UNICODE */ + rv = xrdp_wm_key_unicode(wm, param3, param1); + break; case 0x8001: /* RDP_INPUT_MOUSE */ rv = xrdp_wm_process_input_mouse(wm, param3, param1, param2); break; |