Skip to contentSkip to conversation

Ui 20170727 patches

GIT PULL Applied Gerd Hoffmann 3 participants 15 messages Jul 27, 2017 – Jul 28, 2017

lore
Share & tools
lore
#0 lore raw

The following changes since commit 522fd24ca030c27c591dafedd65c1dfd51e40450:

Update version for v2.10.0-rc0 release (2017-07-25 17:13:09 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/ui-20170727-pull-request

for you to fetch changes up to 7c388dbd0b2c54b3d836c23ea43e2cee38de66a4:

ps2: fix sending of PAUSE/BREAK scancodes (2017-07-27 14:24:05 +0200)

----------------------------------------------------------------
ui: keymap fixes for 2.10

----------------------------------------------------------------

Daniel P. Berrange (1):
ps2: fix sending of PAUSE/BREAK scancodes

Gerd Hoffmann (6):
ui: add next and prior keysyms
ui: move qemu_input_linux_to_qcode()
ui: update keymaps
ui: add multimedia keys
ps2: enable multimedia keys
ui: drop altgr and altgr_r QKeyCodes

 include/ui/input.h |   1 +
 ui/curses_keys.h   |   2 +
 ui/keymaps.h       |   1 +
 ui/vnc_keysym.h    |   2 +
 hw/char/escc.c     |   1 -
 hw/input/adb.c     |   1 -
 hw/input/ps2.c     |   6 --
 ui/input-keymap.c  | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 ui/input-linux.c   | 113 -----------------------------------
 ui/spice-input.c   |  20 +++++++
 qapi-schema.json   |  31 +++++++++-
 11 files changed, 222 insertions(+), 125 deletions(-)
Signature · 1 line
2.9.3
#1 lore raw

[Qemu-devel] [PULL 2/7] ui: move qemu_input_linux_to_qcode()

Move from input-linux.c to input-keymap.c and export it, so the function is available elsewhere too.

Message-id: [email protected]

---
 include/ui/input.h |   1 +
 ui/input-keymap.c  | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 ui/input-linux.c   | 113 ----------------------------------------------------
 3 files changed, 116 insertions(+), 113 deletions(-)
include/ui/input.h +1 -0
index 3cfd0f3363..c488585def 100644
@@ -48,6 +48,7 @@ int qemu_input_key_value_to_number(const KeyValue *value);
 int qemu_input_key_value_to_qcode(const KeyValue *value);
 int qemu_input_key_value_to_scancode(const KeyValue *value, bool down,
                                      int *codes);
+int qemu_input_linux_to_qcode(unsigned int lnx);
 
 InputEvent *qemu_input_event_new_btn(InputButton btn, bool down);
 void qemu_input_queue_btn(QemuConsole *src, InputButton btn, bool down);
ui/input-keymap.c +115 -0

127 lines not on this page · raw message

ui/input-linux.c +0 -113

119 lines not on this page · raw message

Signature · 1 line
2.9.3
#2 lore raw

[Qemu-devel] [PULL 1/7] ui: add next and prior keysyms

In reply to Gerd Hoffmann

Page-up and Page-down were renamed. Add the names to the keysym list so we can parse both old and new names. The keypad versions are already present in the vnc map.

Message-id: [email protected]

---
 ui/curses_keys.h | 2 ++
 ui/vnc_keysym.h  | 2 ++
 2 files changed, 4 insertions(+)
ui/curses_keys.h +2 -0
index e39ef9e718..e9195a1671 100644
@@ -480,7 +480,9 @@ static const name2keysym_t name2keysym[] = {
     { "Left", KEY_LEFT },
     { "Up", KEY_UP },
     { "Down", KEY_DOWN },
+    { "Next", KEY_NPAGE },
     { "Page_Down", KEY_NPAGE },
+    { "Prior", KEY_PPAGE },
     { "Page_Up", KEY_PPAGE },
     { "Insert", KEY_IC },
     { "Delete", KEY_DC },
ui/vnc_keysym.h +2 -0
index 7fa2bc1f1c..e8a2ec73c5 100644
@@ -254,7 +254,9 @@ static const name2keysym_t name2keysym[]={
 {"Left", 0xff51},      /* XK_Left */
 {"Up", 0xff52},        /* XK_Up */
 {"Down", 0xff54},      /* XK_Down */
+{"Next", 0xff56},
 {"Page_Down", 0xff56}, /* XK_Page_Down */
+{"Prior", 0xff55},
 {"Page_Up", 0xff55},   /* XK_Page_Up */
 {"Insert", 0xff63},    /* XK_Insert */
 {"Delete", 0xffff},    /* XK_Delete */
Signature · 1 line
2.9.3
#3 lore raw

[Qemu-devel] [PULL 3/7] ui: update keymaps

In reply to Gerd Hoffmann

Add recently added QKeyCodes to the keymaps.

Message-id: [email protected]

---
 ui/input-keymap.c | 7 +++++++
 1 file changed, 7 insertions(+)
ui/input-keymap.c +7 -0
index d4972bb364..7461e1edde 100644
@@ -94,6 +94,9 @@ static int linux_to_qcode[KEY_CNT] = {
     [KEY_KPASTERISK]     = Q_KEY_CODE_KP_MULTIPLY,
     [KEY_F11]            = Q_KEY_CODE_F11,
     [KEY_F12]            = Q_KEY_CODE_F12,
+    [KEY_RO]             = Q_KEY_CODE_RO,
+    [KEY_HIRAGANA]       = Q_KEY_CODE_HIRAGANA,
+    [KEY_HENKAN]         = Q_KEY_CODE_HENKAN,
     [KEY_RIGHTCTRL]      = Q_KEY_CODE_CTRL_R,
     [KEY_SYSRQ]          = Q_KEY_CODE_SYSRQ,
     [KEY_RIGHTALT]       = Q_KEY_CODE_ALT_R,
@@ -107,6 +110,9 @@ static int linux_to_qcode[KEY_CNT] = {
     [KEY_PAGEDOWN]       = Q_KEY_CODE_PGDN,
     [KEY_INSERT]         = Q_KEY_CODE_INSERT,
     [KEY_DELETE]         = Q_KEY_CODE_DELETE,
+    [KEY_POWER]          = Q_KEY_CODE_POWER,
+    [KEY_KPCOMMA]        = Q_KEY_CODE_KP_COMMA,
+    [KEY_YEN]            = Q_KEY_CODE_YEN,
     [KEY_LEFTMETA]       = Q_KEY_CODE_META_L,
     [KEY_RIGHTMETA]      = Q_KEY_CODE_META_R,
     [KEY_MENU]           = Q_KEY_CODE_MENU,
@@ -242,6 +248,7 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_RO] = 0x73,
     [Q_KEY_CODE_HIRAGANA] = 0x70,
     [Q_KEY_CODE_HENKAN] = 0x79,
+    [Q_KEY_CODE_POWER] = 0xde,
     [Q_KEY_CODE_YEN] = 0x7d,
     [Q_KEY_CODE_KP_COMMA] = 0x7e,
 
Signature · 1 line
2.9.3
#4 lore raw

[Qemu-devel] [PULL 5/7] ps2: enable multimedia keys

In reply to Gerd Hoffmann
Fixes 8c10e0baf0260b59a4e984744462a18016662e3e

Message-id: [email protected]

---
 hw/input/ps2.c | 4 ----
 1 file changed, 4 deletions(-)
hw/input/ps2.c +0 -4
index 3ba05efd06..25ae7fc852 100644
@@ -224,7 +224,6 @@ static const uint16_t qcode_to_keycode_set1[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_DOT] = 0x34,
     [Q_KEY_CODE_SLASH] = 0x35,
 
-#if 0
     [Q_KEY_CODE_POWER] = 0x0e5e,
     [Q_KEY_CODE_SLEEP] = 0x0e5f,
     [Q_KEY_CODE_WAKE] = 0x0e63,
@@ -247,7 +246,6 @@ static const uint16_t qcode_to_keycode_set1[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_AC_STOP] = 0xe068,
     [Q_KEY_CODE_AC_REFRESH] = 0xe067,
     [Q_KEY_CODE_AC_BOOKMARKS] = 0xe066,
-#endif
 
     [Q_KEY_CODE_ASTERISK] = 0x37,
     [Q_KEY_CODE_LESS] = 0x56,
@@ -366,7 +364,6 @@ static const uint16_t qcode_to_keycode_set2[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_DOT] = 0x49,
     [Q_KEY_CODE_SLASH] = 0x4a,
 
-#if 0
     [Q_KEY_CODE_POWER] = 0x0e37,
     [Q_KEY_CODE_SLEEP] = 0x0e3f,
     [Q_KEY_CODE_WAKE] = 0x0e5e,
@@ -389,7 +386,6 @@ static const uint16_t qcode_to_keycode_set2[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_AC_STOP] = 0xe028,
     [Q_KEY_CODE_AC_REFRESH] = 0xe020,
     [Q_KEY_CODE_AC_BOOKMARKS] = 0xe018,
-#endif
 
     [Q_KEY_CODE_ALTGR] = 0x08,
     [Q_KEY_CODE_ALTGR_R] = 0xe008,
Signature · 1 line
2.9.3
#5 lore raw

[Qemu-devel] [PULL 7/7] ps2: fix sending of PAUSE/BREAK scancodes

In reply to Gerd Hoffmann

From: "Daniel P. Berrange" <[email protected]>

The processing of the scancodes for PAUSE/BREAK has been broken since the conversion to qcodes in:

commit 8c10e0baf0260b59a4e984744462a18016662e3e
Author: Hervé Poussineau <[email protected]>
Date: Thu Sep 15 22:06:26 2016 +0200

ps2: use QEMU qcodes instead of scancodes

When using a VNC client, with the raw scancode extension, the client will send a scancode of 0xc6 for both PAUSE and BREAK. There is mistakenly no entry in the qcode_to_number table for this scancode, so ps2_keyboard_event() just generates a log message and discards the scancode

When using a SPICE client, it will also send 0xc6 for BREAK, but will send 0xe1 0x1d 0x45 0xe1 0x9d 0xc5 for PAUSE. There is no entry in the qcode_to_number table for the scancode 0xe1 because it is a special XT keyboard prefix not mapping to any QKeyCode. Again ps2_keyboard_event() just generates a log message and discards the scancode. The following 0x1d, 0x45, 0x9d, 0xc5 scancodes get handled correctly. Rather than trying to handle 3 byte sequences of scancodes in the PS/2 driver, special case the SPICE input code so that it captures the 3 byte pause sequence and turns it into a Pause QKeyCode.

Message-id: [email protected]

---
 ui/keymaps.h      |  1 +
 ui/input-keymap.c |  1 +
 ui/spice-input.c  | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+)
ui/keymaps.h +1 -0
index 47d061343e..8757465529 100644
@@ -59,6 +59,7 @@ typedef struct {
 /* "grey" keys will usually need a 0xe0 prefix */
 #define SCANCODE_GREY   0x80
 #define SCANCODE_EMUL0  0xE0
+#define SCANCODE_EMUL1  0xE1
 /* "up" flag */
 #define SCANCODE_UP     0x80
 
ui/input-keymap.c +1 -0
index f96adf4165..0d9ddde9c9 100644
@@ -233,6 +233,7 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_KP_ENTER] = 0x9c,
     [Q_KEY_CODE_KP_DECIMAL] = 0x53,
     [Q_KEY_CODE_SYSRQ] = 0x54,
+    [Q_KEY_CODE_PAUSE] = 0xc6,
 
     [Q_KEY_CODE_KP_0] = 0x52,
     [Q_KEY_CODE_KP_1] = 0x4f,
ui/spice-input.c +20 -0
index 918580239d..cda9976469 100644
@@ -32,6 +32,7 @@ typedef struct QemuSpiceKbd {
     SpiceKbdInstance sin;
     int ledstate;
     bool emul0;
+    size_t pauseseq;
 } QemuSpiceKbd;
 
 static void kbd_push_key(SpiceKbdInstance *sin, uint8_t frag);
@@ -64,6 +65,25 @@ 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);
 }
 
Signature · 1 line
2.9.3
#6 lore raw

Re: [Qemu-devel] [PULL 7/7] ps2: fix sending of PAUSE/BREAK scancodes

Quoted 88 lines · Gerd Hoffmann

From: "Daniel P. Berrange" <[email protected]>

The processing of the scancodes for PAUSE/BREAK has been broken since the conversion to qcodes in:

commit 8c10e0baf0260b59a4e984744462a18016662e3e
Author: Hervé Poussineau <[email protected]>
Date: Thu Sep 15 22:06:26 2016 +0200

ps2: use QEMU qcodes instead of scancodes

When using a VNC client, with the raw scancode extension, the client will send a scancode of 0xc6 for both PAUSE and BREAK. There is mistakenly no entry in the qcode_to_number table for this scancode, so ps2_keyboard_event() just generates a log message and discards the scancode

When using a SPICE client, it will also send 0xc6 for BREAK, but will send 0xe1 0x1d 0x45 0xe1 0x9d 0xc5 for PAUSE. There is no entry in the qcode_to_number table for the scancode 0xe1 because it is a special XT keyboard prefix not mapping to any QKeyCode. Again ps2_keyboard_event() just generates a log message and discards the scancode. The following 0x1d, 0x45, 0x9d, 0xc5 scancodes get handled correctly. Rather than trying to handle 3 byte sequences of scancodes in the PS/2 driver, special case the SPICE input code so that it captures the 3 byte pause sequence and turns it into a Pause QKeyCode.

Message-id: [email protected]

---
 ui/keymaps.h      |  1 +
 ui/input-keymap.c |  1 +
 ui/spice-input.c  | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+)
ui/keymaps.h +1 -0
index 47d061343e..8757465529 100644
@@ -59,6 +59,7 @@ typedef struct {
 /* "grey" keys will usually need a 0xe0 prefix */
 #define SCANCODE_GREY   0x80
 #define SCANCODE_EMUL0  0xE0
+#define SCANCODE_EMUL1  0xE1
 /* "up" flag */
 #define SCANCODE_UP     0x80
 
ui/input-keymap.c +1 -0
index f96adf4165..0d9ddde9c9 100644
@@ -233,6 +233,7 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_KP_ENTER] = 0x9c,
     [Q_KEY_CODE_KP_DECIMAL] = 0x53,
     [Q_KEY_CODE_SYSRQ] = 0x54,
+    [Q_KEY_CODE_PAUSE] = 0xc6,
 
     [Q_KEY_CODE_KP_0] = 0x52,
     [Q_KEY_CODE_KP_1] = 0x4f,
ui/spice-input.c +12 -0
index 918580239d..cda9976469 100644
@@ -32,6 +32,7 @@ typedef struct QemuSpiceKbd {
     SpiceKbdInstance sin;
     int ledstate;
     bool emul0;
+    size_t pauseseq;
 } QemuSpiceKbd;
 
 static void kbd_push_key(SpiceKbdInstance *sin, uint8_t frag);
@@ -64,6 +65,25 @@ 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) {

ui/spice-input.c static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode) · line 88

Quoted 10 lines
ui/spice-input.c +8 -0
+        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);
 }

Self-NACK.

This impl is unfortunately wrong because it sends two Q_KEY_CODE_PAUSE events, because it mistakenly considered the make + break codes as separate sequences.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#7 lore raw

[Qemu-devel] [PULL 6/7] ui: drop altgr and altgr_r QKeyCodes

In reply to Gerd Hoffmann

The right alt key (alt_r aka KEY_RIGHTALT) is used for AltGr. The altgr and altgr_r keys simply don't exist. Drop them.

Message-id: [email protected]

---
 hw/char/escc.c    | 1 -
 hw/input/adb.c    | 1 -
 hw/input/ps2.c    | 2 --
 ui/input-keymap.c | 2 --
 qapi-schema.json  | 3 ++-
 5 files changed, 2 insertions(+), 7 deletions(-)
hw/char/escc.c +0 -1
index 89ae9eb997..1aca564e33 100644
@@ -722,7 +722,6 @@ static const uint8_t qcode_to_keycode[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_SHIFT_R]       = 110,
     [Q_KEY_CODE_ALT]           = 19,
     [Q_KEY_CODE_ALT_R]         = 13,
-    [Q_KEY_CODE_ALTGR]         = 13,
     [Q_KEY_CODE_CTRL]          = 76,
     [Q_KEY_CODE_CTRL_R]        = 76,
     [Q_KEY_CODE_ESC]           = 29,
hw/input/adb.c +0 -1
index 43d3205472..fcca3a8eb9 100644
@@ -201,7 +201,6 @@ int qcode_to_adb_keycode[] = {
     [Q_KEY_CODE_SHIFT_R]       = ADB_KEY_RIGHT_SHIFT,
     [Q_KEY_CODE_ALT]           = ADB_KEY_LEFT_OPTION,
     [Q_KEY_CODE_ALT_R]         = ADB_KEY_RIGHT_OPTION,
-    [Q_KEY_CODE_ALTGR]         = ADB_KEY_RIGHT_OPTION,
     [Q_KEY_CODE_CTRL]          = ADB_KEY_LEFT_CONTROL,
     [Q_KEY_CODE_CTRL_R]        = ADB_KEY_RIGHT_CONTROL,
     [Q_KEY_CODE_META_L]        = ADB_KEY_COMMAND,
hw/input/ps2.c +0 -2
index 25ae7fc852..9f057e46ea 100644
@@ -387,8 +387,6 @@ static const uint16_t qcode_to_keycode_set2[Q_KEY_CODE__MAX] = {
     [Q_KEY_CODE_AC_REFRESH] = 0xe020,
     [Q_KEY_CODE_AC_BOOKMARKS] = 0xe018,
 
-    [Q_KEY_CODE_ALTGR] = 0x08,
-    [Q_KEY_CODE_ALTGR_R] = 0xe008,
     [Q_KEY_CODE_ASTERISK] = 0x7c,
     [Q_KEY_CODE_LESS] = 0x61,
     [Q_KEY_CODE_SYSRQ] = 0x7f,
ui/input-keymap.c +0 -2
index ae781beae9..f96adf4165 100644
@@ -146,8 +146,6 @@ static const int qcode_to_number[] = {
 
     [Q_KEY_CODE_ALT] = 0x38,
     [Q_KEY_CODE_ALT_R] = 0xb8,
-    [Q_KEY_CODE_ALTGR] = 0x64,
-    [Q_KEY_CODE_ALTGR_R] = 0xe4,
     [Q_KEY_CODE_CTRL] = 0x1d,
     [Q_KEY_CODE_CTRL_R] = 0x9d,
 
qapi-schema.json +2 -1
index 9cb15092a7..dcc12c83a9 100644
@@ -4863,13 +4863,14 @@
 # @ac_stop: since 2.10
 # @ac_refresh: since 2.10
 # @ac_bookmarks: since 2.10
+# altgr, altgr_r: dropped in 2.10
 #
 # Since: 1.3.0
 #
 ##
 { 'enum': 'QKeyCode',
   'data': [ 'unmapped',
-            'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
+            'shift', 'shift_r', 'alt', 'alt_r', 'ctrl',
             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
Signature · 1 line
2.9.3
#8 lore raw

[Qemu-devel] [PULL 4/7] ui: add multimedia keys

In reply to Gerd Hoffmann

Add multimedia keys to QKeyCodes and to the keymaps.

Message-id: [email protected]

---
 ui/input-keymap.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 qapi-schema.json  | 28 +++++++++++++++++++++++++++-
 2 files changed, 71 insertions(+), 1 deletion(-)
ui/input-keymap.c +44 -0
index 7461e1edde..ae781beae9 100644
@@ -116,6 +116,28 @@ 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_SLEEP]          = Q_KEY_CODE_SLEEP,
+    [KEY_WAKEUP]         = Q_KEY_CODE_WAKE,
+    [KEY_CALC]           = Q_KEY_CODE_CALCULATOR,
+    [KEY_MAIL]           = Q_KEY_CODE_MAIL,
+    [KEY_COMPUTER]       = Q_KEY_CODE_COMPUTER,
+
+    [KEY_STOP]           = Q_KEY_CODE_AC_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_NEXTSONG]       = Q_KEY_CODE_AUDIONEXT,
+    [KEY_PREVIOUSSONG]   = Q_KEY_CODE_AUDIOPREV,
+    [KEY_STOPCD]         = Q_KEY_CODE_AUDIOSTOP,
+    [KEY_PLAYCD]         = Q_KEY_CODE_AUDIOPLAY,
+    [KEY_MUTE]           = Q_KEY_CODE_AUDIOMUTE,
+    [KEY_VOLUMEDOWN]     = Q_KEY_CODE_VOLUMEDOWN,
+    [KEY_VOLUMEUP]       = Q_KEY_CODE_VOLUMEUP,
 };
 
 static const int qcode_to_number[] = {
@@ -252,6 +274,28 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_YEN] = 0x7d,
     [Q_KEY_CODE_KP_COMMA] = 0x7e,
 
+    [Q_KEY_CODE_SLEEP] = 0xdf,
+    [Q_KEY_CODE_WAKE] = 0xe3,
+    [Q_KEY_CODE_CALCULATOR] = 0xa1,
+    [Q_KEY_CODE_MAIL] = 0xec,
+    [Q_KEY_CODE_COMPUTER] = 0xeb,
+
+    [Q_KEY_CODE_AC_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_AUDIONEXT] = 0x99,
+    [Q_KEY_CODE_AUDIOPREV] = 0x90,
+    [Q_KEY_CODE_AUDIOSTOP] = 0xa4,
+    [Q_KEY_CODE_AUDIOPLAY] = 0xa2,
+    [Q_KEY_CODE_AUDIOMUTE] = 0xa0,
+    [Q_KEY_CODE_VOLUMEDOWN] = 0xae,
+    [Q_KEY_CODE_VOLUMEUP] = 0xb0,
+
     [Q_KEY_CODE__MAX] = 0,
 };
 
qapi-schema.json +27 -1
index 9c6c3e1a53..9cb15092a7 100644
@@ -4843,6 +4843,27 @@
 # @henkan: since 2.9
 # @yen: since 2.9
 #
+# @sleep: since 2.10
+# @wake: since 2.10
+# @audionext: since 2.10
+# @audioprev: since 2.10
+# @audiostop: since 2.10
+# @audioplay: since 2.10
+# @audiomute: since 2.10
+# @volumeup: since 2.10
+# @volumedown: since 2.10
+# @mediaselect: since 2.10
+# @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
+#
 # Since: 1.3.0
 #
 ##
@@ -4864,7 +4885,12 @@
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
             'ro', 'hiragana', 'henkan', 'yen',
-            'kp_comma', 'kp_equals', 'power' ] }
+            'kp_comma', 'kp_equals', 'power', 'sleep', 'wake',
+            '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' ] }
 
 ##
 # @KeyValue:
Signature · 1 line
2.9.3
#9 lore raw

Re: [Qemu-devel] [PULL 4/7] ui: add multimedia keys

Quoted 16 lines · Gerd Hoffmann

Add multimedia keys to QKeyCodes and to the keymaps.

Message-id: [email protected]

---
 ui/input-keymap.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 qapi-schema.json  | 28 +++++++++++++++++++++++++++-
 2 files changed, 71 insertions(+), 1 deletion(-)
ui/input-keymap.c +0 -0
index 7461e1edde..ae781beae9 100644
@@ -116,6 +116,28 @@ static int linux_to_qcode[KEY_CNT] = {
     [KEY_LEFTMETA]       = Q_KEY_CODE_META_L,

ui/input-keymap.c static int linux_to_qcode[KEY_CNT] = { · line 126

Quoted 10 lines
ui/input-keymap.c +8 -0
     [KEY_RIGHTMETA]      = Q_KEY_CODE_META_R,
     [KEY_MENU]           = Q_KEY_CODE_MENU,
+
+    [KEY_SLEEP]          = Q_KEY_CODE_SLEEP,
+    [KEY_WAKEUP]         = Q_KEY_CODE_WAKE,
+    [KEY_CALC]           = Q_KEY_CODE_CALCULATOR,
+    [KEY_MAIL]           = Q_KEY_CODE_MAIL,
+    [KEY_COMPUTER]       = Q_KEY_CODE_COMPUTER,
+
+    [KEY_STOP]           = Q_KEY_CODE_AC_STOP,

We already have a Q_KEY_CODE_STOP that I think is the correct mapping for KEY_STOP, so this new Q_KEY_CODE_AC_STOP looks like a dupe.

ui/input-keymap.c static int linux_to_qcode[KEY_CNT] = { · line 132

Quoted 6 lines
ui/input-keymap.c +6 -0
+    [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,

Similarly we already have a Q_KEY_CODE_FIND that should map to KEY_FIND, so this Q_KEY_CODE_AC_SEARCH is another dup AFAICT.

I'm curious what the 'AC_' prefix on all these is indicating ? Do we actually need it ?

ui/input-keymap.c static int linux_to_qcode[KEY_CNT] = { · line 140

Quoted 8 lines
ui/input-keymap.c +8 -0
+
+    [KEY_NEXTSONG]       = Q_KEY_CODE_AUDIONEXT,
+    [KEY_PREVIOUSSONG]   = Q_KEY_CODE_AUDIOPREV,
+    [KEY_STOPCD]         = Q_KEY_CODE_AUDIOSTOP,
+    [KEY_PLAYCD]         = Q_KEY_CODE_AUDIOPLAY,
+    [KEY_MUTE]           = Q_KEY_CODE_AUDIOMUTE,
+    [KEY_VOLUMEDOWN]     = Q_KEY_CODE_VOLUMEDOWN,
+    [KEY_VOLUMEUP]       = Q_KEY_CODE_VOLUMEUP,

Missing Q_KEY_CODE_MEDIASELECT entry - presumably it was supposed to map to KEY_MEDIA

Quoted 18 lines
ui/input-keymap.c +11 -0
 };
 
 static const int qcode_to_number[] = {
@@ -252,6 +274,28 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_YEN] = 0x7d,
     [Q_KEY_CODE_KP_COMMA] = 0x7e,
 
+    [Q_KEY_CODE_SLEEP] = 0xdf,
+    [Q_KEY_CODE_WAKE] = 0xe3,
+    [Q_KEY_CODE_CALCULATOR] = 0xa1,
+    [Q_KEY_CODE_MAIL] = 0xec,
+    [Q_KEY_CODE_COMPUTER] = 0xeb,
+
+    [Q_KEY_CODE_AC_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,

ui/input-keymap.c static const int qcode_to_number[] = { · line 297

Quoted 10 lines
ui/input-keymap.c +10 -0
+    [Q_KEY_CODE_AC_REFRESH] = 0xe7,
+    [Q_KEY_CODE_AC_SEARCH] = 0xe5,
+
+    [Q_KEY_CODE_AUDIONEXT] = 0x99,
+    [Q_KEY_CODE_AUDIOPREV] = 0x90,
+    [Q_KEY_CODE_AUDIOSTOP] = 0xa4,
+    [Q_KEY_CODE_AUDIOPLAY] = 0xa2,
+    [Q_KEY_CODE_AUDIOMUTE] = 0xa0,
+    [Q_KEY_CODE_VOLUMEDOWN] = 0xae,
+    [Q_KEY_CODE_VOLUMEUP] = 0xb0,

Again no MEDIASELECT entry

Quoted 54 lines
ui/input-keymap.c +1 -0
+
     [Q_KEY_CODE__MAX] = 0,
 };
 
qapi-schema.json +27 -1
index 9c6c3e1a53..9cb15092a7 100644
@@ -4843,6 +4843,27 @@
 # @henkan: since 2.9
 # @yen: since 2.9
 #
+# @sleep: since 2.10
+# @wake: since 2.10
+# @audionext: since 2.10
+# @audioprev: since 2.10
+# @audiostop: since 2.10
+# @audioplay: since 2.10
+# @audiomute: since 2.10
+# @volumeup: since 2.10
+# @volumedown: since 2.10
+# @mediaselect: since 2.10
+# @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
+#
 # Since: 1.3.0
 #
 ##
@@ -4864,7 +4885,12 @@
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
             'ro', 'hiragana', 'henkan', 'yen',
-            'kp_comma', 'kp_equals', 'power' ] }
+            'kp_comma', 'kp_equals', 'power', 'sleep', 'wake',
+            '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' ] }
 
 ##
 # @KeyValue:
Signature · 1 line
2.9.3

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#10 lore raw

Re: [Qemu-devel] [PULL 4/7] ui: add multimedia keys

Quoted 23 lines · Daniel P. Berrange
Quoted 22 lines · Gerd Hoffmann

Add multimedia keys to QKeyCodes and to the keymaps.

Message-id: [email protected]
---
 ui/input-keymap.c | 44
++++++++++++++++++++++++++++++++++++++++++++
 qapi-schema.json  | 28 +++++++++++++++++++++++++++-

 2 files changed, 71 insertions(+), 1 deletion(-)
ui/input-keymap.c +3 -0
index 7461e1edde..ae781beae9 100644
@@ -116,6 +116,28 @@ 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_SLEEP]          = Q_KEY_CODE_SLEEP,
+    [KEY_WAKEUP]         = Q_KEY_CODE_WAKE,
Quoted 8 lines

ui/input-keymap.c static int linux_to_qcode[KEY_CNT] = { · line 126

Quoted 5 lines
ui/input-keymap.c +5 -0
+    [KEY_CALC]           = Q_KEY_CODE_CALCULATOR,
+    [KEY_MAIL]           = Q_KEY_CODE_MAIL,
+    [KEY_COMPUTER]       = Q_KEY_CODE_COMPUTER,
+
+    [KEY_STOP]           = Q_KEY_CODE_AC_STOP,

We already have a Q_KEY_CODE_STOP that I think is the correct mapping for KEY_STOP, so this new Q_KEY_CODE_AC_STOP looks like a dupe.

Oops, missed that indeed.

Quoted 9 lines

ui/input-keymap.c static int linux_to_qcode[KEY_CNT] = { · line 132

Quoted 6 lines
ui/input-keymap.c +6 -0
+    [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,

Similarly we already have a Q_KEY_CODE_FIND that should map to KEY_FIND, so this Q_KEY_CODE_AC_SEARCH is another dup AFAICT.

Yes.

Quoted 2 lines

I'm curious what the 'AC_' prefix on all these is indicating ? Do we actually need it ?

Seems to stand for "application control".

# grep " AC " include/standard-headers/linux/input-event-codes.h 
 * AC - Application Control
#define KEY_STOP                128     /* AC Stop */
#define KEY_PROPS               130     /* AC Properties */
#define KEY_UNDO                131     /* AC Undo */
[ ... ]

I think it is better to keep it, even if it is inconsistent because we
already have stop + find without prefix. Just dropping the ac_ prefix
will not work for some keys, ac_home for example.

Quoted 2 lines

Missing Q_KEY_CODE_MEDIASELECT entry - presumably it was supposed to map to  KEY_MEDIA

There is KEY_SELECT too, but not KEY_MEDIASELECT. Hmm.

cheers,
Gerd

#11 lore raw

Re: [Qemu-devel] [PULL 4/7] ui: add multimedia keys

Quoted 26 lines · Gerd Hoffmann
Quoted 13 lines · Daniel P. Berrange
Quoted 11 lines · Gerd Hoffmann

Add multimedia keys to QKeyCodes and to the keymaps.

Message-id: [email protected]
---
 ui/input-keymap.c | 44
++++++++++++++++++++++++++++++++++++++++++++
 qapi-schema.json  | 28 +++++++++++++++++++++++++++-

 2 files changed, 71 insertions(+), 1 deletion(-)
Quoted 2 lines

I'm curious what the 'AC_' prefix on all these is indicating ? Do we actually need it ?

Seems to stand for "application control".

# grep " AC " include/standard-headers/linux/input-event-codes.h 
 * AC - Application Control
#define KEY_STOP                128     /* AC Stop */
#define KEY_PROPS               130     /* AC Properties */
#define KEY_UNDO                131     /* AC Undo */
[ ... ]
Quoted 3 lines

I think it is better to keep it, even if it is inconsistent because we
already have stop + find without prefix. Just dropping the ac_ prefix
will not work for some keys, ac_home for example.

Ok

Quoted 5 lines
Quoted 3 lines

Missing Q_KEY_CODE_MEDIASELECT entry - presumably it was supposed to map to  KEY_MEDIA

There is KEY_SELECT too, but not KEY_MEDIASELECT. Hmm.

I found a keyboard with a key labelled "Media" and when pressed it generates Linux key 171 / AT set1 0xe0 0x01 which is KEY_CONFIG and GNOME pops up the control panel when pressed !

Would be interested to know results of "showkey" and "showkey -s" for any other keyboards with a key labelled "Media", since I don't entirely trust this particular one to be representative of general usage.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#12 lore raw

Re: [Qemu-devel] [PULL 4/7] ui: add multimedia keys

Hi,

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Missing Q_KEY_CODE_MEDIASELECT entry - presumably it was supposed to map to  KEY_MEDIA

There is KEY_SELECT too, but not KEY_MEDIASELECT.  Hmm.

I found a keyboard with a key labelled "Media"  and when pressed it generates Linux key 171  / AT set1  0xe0 0x01 which is KEY_CONFIG and GNOME pops up the control panel when pressed !

Oh joy!

I guess we should just leave that unmapped for 2.10 and sort it later when switching to keycodemapdb ...

Quoted 4 lines

Would be interested to know results of "showkey" and "showkey -s" for any other keyboards with a key labelled "Media", since I don't entirely
trust this particular one to be representative of general usage.

I don't have any. Seems those multimedia keyboards with lots of extra
keys are out-of-fashion these days, with only a few keys (like volume) still being in use.

cheers,
Gerd

#13 lore raw

Re: [Qemu-devel] [PULL 4/7] ui: add multimedia keys

Quoted 7 lines · Gerd Hoffmann

Hi,

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Missing Q_KEY_CODE_MEDIASELECT entry - presumably it was supposed to map to  KEY_MEDIA

There is KEY_SELECT too, but not KEY_MEDIASELECT.  Hmm.

Quoted 8 lines
Quoted 3 lines

I found a keyboard with a key labelled "Media"  and when pressed it generates Linux key 171  / AT set1  0xe0 0x01 which is KEY_CONFIG and GNOME pops up the control panel when pressed !

Oh joy!

I guess we should just leave that unmapped for 2.10 and sort it later when switching to keycodemapdb ...

Ok, I found a reference

http://www.computer-engineering.org/ps2keyboard/scancodes1.html

Lists 'Media select' as generating 0xe0 0x6d, which corresponds to KEY_MEDIA in Linux.

So that confirms my keyboard is simply incorrectly labelled or wired up, as suspected.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#14 lore raw
In reply to Gerd Hoffmann
Quoted 8 lines · Gerd Hoffmann

The following changes since commit 522fd24ca030c27c591dafedd65c1dfd51e40450:

Update version for v2.10.0-rc0 release (2017-07-25 17:13:09 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/ui-20170727-pull-request

Quoted 8 lines

for you to fetch changes up to 7c388dbd0b2c54b3d836c23ea43e2cee38de66a4:

ps2: fix sending of PAUSE/BREAK scancodes (2017-07-27 14:24:05 +0200)

----------------------------------------------------------------
ui: keymap fixes for 2.10

----------------------------------------------------------------

Applied, thanks.

-- PMM