ps2: Don't send key release event for Lang1, Lang2 keys
The scancodes for the Lang1 and Lang2 keys (i.e. Hangeul, Hanja) are special since they already have the 0x80 bit set which is commonly used to indicate a key release in AT set 1. Reportedly, real hardware does not send a key release scancode. So, skip sending a release for these keys. This ensures that Windows behaves correctly and interprets it as a single keypress rather than two consecutive keypresses. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
ac19b51678
commit
92f4a21d91
@ -402,6 +402,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src,
|
|||||||
ps2_put_keycode(s, 0xaa);
|
ps2_put_keycode(s, 0xaa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if ((qcode == Q_KEY_CODE_LANG1 || qcode == Q_KEY_CODE_LANG2)
|
||||||
|
&& !key->down) {
|
||||||
|
/* Ignore release for these keys */
|
||||||
} else {
|
} else {
|
||||||
if (qcode < qemu_input_map_qcode_to_atset1_len) {
|
if (qcode < qemu_input_map_qcode_to_atset1_len) {
|
||||||
keycode = qemu_input_map_qcode_to_atset1[qcode];
|
keycode = qemu_input_map_qcode_to_atset1[qcode];
|
||||||
@ -497,6 +500,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src,
|
|||||||
ps2_put_keycode(s, 0x12);
|
ps2_put_keycode(s, 0x12);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if ((qcode == Q_KEY_CODE_LANG1 || qcode == Q_KEY_CODE_LANG2) &&
|
||||||
|
!key->down) {
|
||||||
|
/* Ignore release for these keys */
|
||||||
} else {
|
} else {
|
||||||
if (qcode < qemu_input_map_qcode_to_atset2_len) {
|
if (qcode < qemu_input_map_qcode_to_atset2_len) {
|
||||||
keycode = qemu_input_map_qcode_to_atset2[qcode];
|
keycode = qemu_input_map_qcode_to_atset2[qcode];
|
||||||
|
Loading…
Reference in New Issue
Block a user