ui: more keymap fixes for 2.10

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJZezUVAAoJEEy22O7T6HE4ZPsP/1IG6CLs6x49ckjfKDIZnjIv
 NVjrI0kvj4okZApDT7ro/4B4NqTTP87pPCF7fEW5P3Qh+BbVkiyKRdDJHR0dk5kG
 EMQQOvZAvyq9xWoq0r+Mhh7fQmqLDXDUse88eFXk24fc73JQWsrIDRltpCJYMTLX
 F6mKCylgM86n3UBTxhDDylMX5Zui+qiToT88LJ+Eorj6HosD36Fu1cH4v3lB0YSb
 DbipMx1dbGydJNTjSaKl42etLAbHpqtlfNlAXkprksM3wnxhAQedgddQ2M2JNgUZ
 ep3LisR4iIA6mUBt/MnO7SWCPypOpiXAyR0MbEy4bk7SpaQ/sidE5ti+ckA0plBJ
 HgbvsWBLAfoQ1R4bUQm2He8z7GyKpJOowZm10y+feKvaF4GjIszlQF5r+Zihy8iF
 HjqlEIeLaqz34lHOMPfpa6MzCHpFXwY8yaHpTh2nUKyI4lgnuhO32uupiaVBnWQq
 JrGIr3wDOTJ0CTnOqu1WLRKnE6n+xI2skQ4dcJ0tOPVx7rPhtm8K5JBYRyb77ELQ
 HA3bV5kTJZLCGPjikl7At3Ekyx28sseGEBaGd4GeYBMCGKoeThAxNi0JDh/zRby8
 WxRKrxdiRj88qBuNSpneWHQ4EjyTG5hzbfNFC0yG7mq5hvG0tYxthe6msF0omwbz
 dMp3f5pwWpmQ0kiny3Pf
 =jdk3
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170728-pull-request' into staging

ui: more keymap fixes for 2.10

# gpg: Signature made Fri 28 Jul 2017 13:59:01 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20170728-pull-request:
  ui: add pause key to linux_to_qcode
  ui: drop ac_search and ac_stop
  ui: correctly detect spice PAUSE scancode sequence

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-07-28 14:20:17 +01:00
commit 762971738c
4 changed files with 23 additions and 31 deletions

View File

@ -239,11 +239,11 @@ static const uint16_t qcode_to_keycode_set1[Q_KEY_CODE__MAX] = {
[Q_KEY_CODE_MAIL] = 0xe06c,
[Q_KEY_CODE_CALCULATOR] = 0xe021,
[Q_KEY_CODE_COMPUTER] = 0xe06b,
[Q_KEY_CODE_AC_SEARCH] = 0xe065,
[Q_KEY_CODE_FIND] = 0xe065,
[Q_KEY_CODE_AC_HOME] = 0xe032,
[Q_KEY_CODE_AC_BACK] = 0xe06a,
[Q_KEY_CODE_AC_FORWARD] = 0xe069,
[Q_KEY_CODE_AC_STOP] = 0xe068,
[Q_KEY_CODE_STOP] = 0xe068,
[Q_KEY_CODE_AC_REFRESH] = 0xe067,
[Q_KEY_CODE_AC_BOOKMARKS] = 0xe066,
@ -379,11 +379,11 @@ static const uint16_t qcode_to_keycode_set2[Q_KEY_CODE__MAX] = {
[Q_KEY_CODE_MAIL] = 0xe048,
[Q_KEY_CODE_CALCULATOR] = 0xe02b,
[Q_KEY_CODE_COMPUTER] = 0xe040,
[Q_KEY_CODE_AC_SEARCH] = 0xe010,
[Q_KEY_CODE_FIND] = 0xe010,
[Q_KEY_CODE_AC_HOME] = 0xe03a,
[Q_KEY_CODE_AC_BACK] = 0xe038,
[Q_KEY_CODE_AC_FORWARD] = 0xe030,
[Q_KEY_CODE_AC_STOP] = 0xe028,
[Q_KEY_CODE_STOP] = 0xe028,
[Q_KEY_CODE_AC_REFRESH] = 0xe020,
[Q_KEY_CODE_AC_BOOKMARKS] = 0xe018,

View File

@ -4856,11 +4856,9 @@
# @mail: since 2.10
# @calculator: since 2.10
# @computer: since 2.10
# @ac_search: since 2.10
# @ac_home: since 2.10
# @ac_back: since 2.10
# @ac_forward: since 2.10
# @ac_stop: since 2.10
# @ac_refresh: since 2.10
# @ac_bookmarks: since 2.10
# altgr, altgr_r: dropped in 2.10
@ -4890,8 +4888,7 @@
'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
'volumeup', 'volumedown', 'mediaselect',
'mail', 'calculator', 'computer',
'ac_search', 'ac_home', 'ac_back', 'ac_forward', 'ac_stop',
'ac_refresh', 'ac_bookmarks' ] }
'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
##
# @KeyValue:

View File

@ -116,6 +116,7 @@ static int linux_to_qcode[KEY_CNT] = {
[KEY_LEFTMETA] = Q_KEY_CODE_META_L,
[KEY_RIGHTMETA] = Q_KEY_CODE_META_R,
[KEY_MENU] = Q_KEY_CODE_MENU,
[KEY_PAUSE] = Q_KEY_CODE_PAUSE,
[KEY_SLEEP] = Q_KEY_CODE_SLEEP,
[KEY_WAKEUP] = Q_KEY_CODE_WAKE,
@ -123,13 +124,13 @@ static int linux_to_qcode[KEY_CNT] = {
[KEY_MAIL] = Q_KEY_CODE_MAIL,
[KEY_COMPUTER] = Q_KEY_CODE_COMPUTER,
[KEY_STOP] = Q_KEY_CODE_AC_STOP,
[KEY_STOP] = Q_KEY_CODE_STOP,
[KEY_BOOKMARKS] = Q_KEY_CODE_AC_BOOKMARKS,
[KEY_BACK] = Q_KEY_CODE_AC_BACK,
[KEY_FORWARD] = Q_KEY_CODE_AC_FORWARD,
[KEY_HOMEPAGE] = Q_KEY_CODE_AC_HOME,
[KEY_REFRESH] = Q_KEY_CODE_AC_REFRESH,
[KEY_FIND] = Q_KEY_CODE_AC_SEARCH,
[KEY_FIND] = Q_KEY_CODE_FIND,
[KEY_NEXTSONG] = Q_KEY_CODE_AUDIONEXT,
[KEY_PREVIOUSSONG] = Q_KEY_CODE_AUDIOPREV,
@ -279,13 +280,13 @@ static const int qcode_to_number[] = {
[Q_KEY_CODE_MAIL] = 0xec,
[Q_KEY_CODE_COMPUTER] = 0xeb,
[Q_KEY_CODE_AC_STOP] = 0xe8,
[Q_KEY_CODE_STOP] = 0xe8,
[Q_KEY_CODE_AC_BOOKMARKS] = 0xe6,
[Q_KEY_CODE_AC_BACK] = 0xea,
[Q_KEY_CODE_AC_FORWARD] = 0xe9,
[Q_KEY_CODE_AC_HOME] = 0xb2,
[Q_KEY_CODE_AC_REFRESH] = 0xe7,
[Q_KEY_CODE_AC_SEARCH] = 0xe5,
[Q_KEY_CODE_FIND] = 0xe5,
[Q_KEY_CODE_AUDIONEXT] = 0x99,
[Q_KEY_CODE_AUDIOPREV] = 0x90,

View File

@ -50,6 +50,7 @@ static const SpiceKbdInterface kbd_interface = {
static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
{
static const uint8_t pauseseq[] = { 0xe1, 0x1d, 0x45, 0xe1, 0x9d, 0xc5 };
QemuSpiceKbd *kbd = container_of(sin, QemuSpiceKbd, sin);
int keycode;
bool up;
@ -58,6 +59,18 @@ static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
kbd->emul0 = true;
return;
}
if (scancode == pauseseq[kbd->pauseseq]) {
kbd->pauseseq++;
if (kbd->pauseseq == G_N_ELEMENTS(pauseseq)) {
qemu_input_event_send_key_qcode(NULL, Q_KEY_CODE_PAUSE, true);
kbd->pauseseq = 0;
}
return;
} else {
kbd->pauseseq = 0;
}
keycode = scancode & ~SCANCODE_UP;
up = scancode & SCANCODE_UP;
if (kbd->emul0) {
@ -65,25 +78,6 @@ static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
keycode |= SCANCODE_GREY;
}
if (scancode == SCANCODE_EMUL1) {
kbd->pauseseq++;
return;
} else if (kbd->pauseseq == 1) {
if (keycode == 0x1d) {
kbd->pauseseq++;
return;
} else {
kbd->pauseseq = 0;
}
} else if (kbd->pauseseq == 2) {
if (keycode == 0x45) {
qemu_input_event_send_key_qcode(NULL, Q_KEY_CODE_PAUSE, !up);
kbd->pauseseq = 0;
return;
}
kbd->pauseseq = 0;
}
qemu_input_event_send_key_number(NULL, keycode, !up);
}