mirror of https://github.com/xqemu/xqemu.git
vnc: fix numlock+capslock tracking
This patch makes the numlock+capslock tracking logic only look at keydown events. Without this patch the vnc server will insert bogous capslock keypress in case it sees the following key sequence: shift down --- 'A' down --- shift up --- 'A' up ^ here It doesn't hurt with a PS/2 keyboard, but it disturbs the USB Keyboard. And with the key event queue just added to the usb keyboard the guest will actually notice. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
42292d4e51
commit
9892088b52
4
ui/vnc.c
4
ui/vnc.c
|
@ -1504,7 +1504,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vs->vd->lock_key_sync &&
|
if (down && vs->vd->lock_key_sync &&
|
||||||
keycode_is_keypad(vs->vd->kbd_layout, keycode)) {
|
keycode_is_keypad(vs->vd->kbd_layout, keycode)) {
|
||||||
/* If the numlock state needs to change then simulate an additional
|
/* If the numlock state needs to change then simulate an additional
|
||||||
keypress before sending this one. This will happen if the user
|
keypress before sending this one. This will happen if the user
|
||||||
|
@ -1523,7 +1523,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vs->vd->lock_key_sync &&
|
if (down && vs->vd->lock_key_sync &&
|
||||||
((sym >= 'A' && sym <= 'Z') || (sym >= 'a' && sym <= 'z'))) {
|
((sym >= 'A' && sym <= 'Z') || (sym >= 'a' && sym <= 'z'))) {
|
||||||
/* If the capslock state needs to change then simulate an additional
|
/* If the capslock state needs to change then simulate an additional
|
||||||
keypress before sending this one. This will happen if the user
|
keypress before sending this one. This will happen if the user
|
||||||
|
|
Loading…
Reference in New Issue