--- xrdp-0.4.1.orig/xrdp/lang.c +++ xrdp-0.4.1/xrdp/lang.c @@ -302,7 +302,7 @@ 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1', - '2', '3', '0', '.', 0, 0, 0, 0, + '2', '3', '0', '.', 0, 0, '<', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -323,7 +323,7 @@ 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1', - '2', '3', '0', '.', 0, 0, 0, 0, + '2', '3', '0', '.', 0, 0, '>', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -344,7 +344,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, '|', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -544,6 +544,6 @@ shift = keys[42] || keys[54]; - altgr = keys[56]; /* right alt */ + altgr = keys[56]; /* left or right alt */ - ext = device_flags & 0x0100; + ext = altgr ? 0 : (device_flags & 0x0100); /* no ext, if any alt */ rv = 0; if (scan_code >= 128) { --- xrdp-0.4.1.orig/vnc/vnc.c +++ xrdp-0.4.1/vnc/vnc.c @@ -292,10 +292,22 @@ case 0x0038: /* left-right alt */ if (param2 & 0x0100) /* right alt */ { + key = 0xffea; /* only en-us keymap can send right alt(alt-gr) */ - if (v->keylayout == 0x409) + /* other keymaps: cancel effects of a unwanted ctl-l, which is send just before alt-gr */ + if (v->keylayout != 0x409) { - key = 0xffea; + if (msg == 15) /* if alt-gr is pressed, send a ctl-l release before */ + { + init_stream(s, 8192); + out_uint8(s, 4); + out_uint8(s, 0); /* release */ + out_uint8s(s, 2); + out_uint32_be(s, 0xffe3); /* ctl-l */ + error = lib_send(v, s->data, 8); + free_stream(s); + make_stream(s); + } } } else /* left alt */