summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2006-12-09 19:30:57 +0000
committerjsorg71 <jsorg71>2006-12-09 19:30:57 +0000
commitb295e08ad2f450f5bda8682d82a865b0db531382 (patch)
tree0f9af7c907deb72b639679f30b19e5f65acfec94
parent778b1489d767fdf89befe8be9a91e3ee9e0aed1e (diff)
downloadxrdp-proprietary-b295e08ad2f450f5bda8682d82a865b0db531382.tar.gz
xrdp-proprietary-b295e08ad2f450f5bda8682d82a865b0db531382.zip
let module decide if alt-gr needs to be ignored
-rw-r--r--vnc/vnc.c25
-rw-r--r--vnc/vnc.h1
-rw-r--r--xrdp/lang.c12
-rw-r--r--xrdp/xrdp_wm.c8
4 files changed, 22 insertions, 24 deletions
diff --git a/vnc/vnc.c b/vnc/vnc.c
index 8f5539df..cf47b94e 100644
--- a/vnc/vnc.c
+++ b/vnc/vnc.c
@@ -190,7 +190,18 @@ lib_mod_event(struct vnc* v, int msg, long param1, long param2,
v->shift_state = (msg == 15);
break;
case 0x0038: /* left-right alt */
- key = (param2 & 0x0100) ? 0xffea : 0xffe9;
+ if (param2 & 0x0100) /* right alt */
+ {
+ /* only en-us keymap can send right alt(alt-gr) */
+ if (v->keylayout == 0x409)
+ {
+ key = 0xffea;
+ }
+ }
+ else /* left alt */
+ {
+ key = 0xffe9;
+ }
break;
case 0x003b: /* F1 */
key = 0xffbe;
@@ -1102,22 +1113,26 @@ lib_mod_end(struct vnc* v)
int DEFAULT_CC
lib_mod_set_param(struct vnc* v, char* name, char* value)
{
- if (g_strncasecmp(name, "username", 8) == 0)
+ if (g_strcasecmp(name, "username") == 0)
{
g_strncpy(v->username, value, 255);
}
- else if (g_strncasecmp(name, "password", 8) == 0)
+ else if (g_strcasecmp(name, "password") == 0)
{
g_strncpy(v->password, value, 255);
}
- else if (g_strncasecmp(name, "ip", 2) == 0)
+ else if (g_strcasecmp(name, "ip") == 0)
{
g_strncpy(v->ip, value, 255);
}
- else if (g_strncasecmp(name, "port", 4) == 0)
+ else if (g_strcasecmp(name, "port") == 0)
{
g_strncpy(v->port, value, 255);
}
+ else if (g_strcasecmp(name, "keylayout") == 0)
+ {
+ v->keylayout = g_atoi(value);
+ }
return 0;
}
diff --git a/vnc/vnc.h b/vnc/vnc.h
index e227c6f1..90dc14cf 100644
--- a/vnc/vnc.h
+++ b/vnc/vnc.h
@@ -92,4 +92,5 @@ struct vnc
char port[256];
int sck_closed;
int shift_state; /* 0 up, 1 down */
+ int keylayout;
};
diff --git a/xrdp/lang.c b/xrdp/lang.c
index 33b9f4e3..72733916 100644
--- a/xrdp/lang.c
+++ b/xrdp/lang.c
@@ -431,54 +431,42 @@ get_char_from_scan_code(int device_flags, int scan_code, int* keys,
int shift;
int altgr;
int ext;
- int has_altgr;
if (keylayout == 0x40c) /* france */
{
keys_noshift = fr_noshift;
keys_shift = fr_shift;
keys_altgr = fr_altgr;
- has_altgr = 1;
}
else if (keylayout == 0x809) /* en-uk or en-gb */
{
keys_noshift = en_uk_noshift;
keys_shift = en_uk_shift;
keys_altgr = en_uk_altgr;
- has_altgr = 1;
}
else if (keylayout == 0x407) /* german */
{
keys_noshift = de_noshift;
keys_shift = de_shift;
keys_altgr = de_altgr;
- has_altgr = 1;
}
else if (keylayout == 0x416) /* Portuguese (Brazil) */
{
keys_noshift = pt_br_noshift;
keys_shift = pt_br_shift;
keys_altgr = pt_br_altgr;
- has_altgr = 1;
}
else if (keylayout == 0x410) /* italy */
{
keys_noshift = it_noshift;
keys_shift = it_shift;
keys_altgr = it_altgr;
- has_altgr = 1;
}
else /* english us 0x409 */
{
keys_noshift = en_us_noshift;
keys_shift = en_us_shift;
keys_altgr = en_us_altgr;
- has_altgr = 0;
- }
- /* don't send altgr */
- if (has_altgr && (scan_code == 56) && (device_flags & 0x100))
- {
- return 1;
}
/*g_writeln("%d %d %x", scan_code, device_flags, keylayout);*/
shift = keys[42] || keys[54];
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 9c6cdb2f..401a5e4f 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -1171,13 +1171,7 @@ xrdp_wm_key(struct xrdp_wm* self, int device_flags, int scan_code)
self->num_lock,
self->scroll_lock,
self->session->client_info->keylayout);
- /* this means don't send anything */
- /* used to qvoid sending alt to xserver eg altgr */
- /* if alt state is down, the xserver avoids the keystroke */
- if (c == 1)
- {
- }
- else if (c != 0)
+ if (c != 0)
{
self->mod->mod_event(self->mod, msg, (unsigned char)c, 0xffff,
scan_code, device_flags);