summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_wm.c
diff options
context:
space:
mode:
Diffstat (limited to 'xrdp/xrdp_wm.c')
-rw-r--r--xrdp/xrdp_wm.c77
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;