--- a/tools/ioemu-qemu-xen/keymaps.c Wed Jan 05 23:16:54 2011 +0000 +++ b/tools/ioemu-qemu-xen/keymaps.c Wed Jan 05 23:48:36 2011 +0000 @@ -53,6 +53,20 @@ typedef struct { struct key_range *localstate_range; struct key_range *altgr_range; } kbd_layout_t; + +static void del_key_range(struct key_range **krp, int code) { + struct key_range *kr; + struct key_range *kr_pr; + for (kr = *krp; kr; kr_pr = kr, kr = kr->next) { + if (code >= kr->start && code <= kr->end) { + if (kr == *krp) + *krp = kr->next; + else + kr_pr->next = kr->next; + qemu_free(kr); + } + } +} static void add_to_key_range(struct key_range **krp, int code) { struct key_range *kr; @@ -137,6 +151,8 @@ static kbd_layout_t *parse_keyboard_layo if (rest && strstr(rest, "altgr")) { add_to_key_range(&k->altgr_range, keysym); //fprintf(stderr, "altgr keysym %04x keycode %d\n", keysym, keycode); + } else { + del_key_range(&k->altgr_range, keysym); } /* if(keycode&0x80) --- a/tools/ioemu-qemu-xen/vnc.c Wed Jan 05 23:16:54 2011 +0000 +++ b/tools/ioemu-qemu-xen/vnc.c Wed Jan 05 23:48:36 2011 +0000 @@ -1279,11 +1279,9 @@ static void press_key_altgr_down(VncStat kbd_put_keycode(0xe0); if (down){ kbd_put_keycode(0xb8 & 0x7f); - vs->modifiers_state[0xb8] = 1; } else { kbd_put_keycode(0xb8 | 0x80); - vs->modifiers_state[0xb8] = 0; } }