aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-07-27 15:27:06 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-07-27 15:27:06 +0100
commite01151de165070c25a1b202e9e2392950bd7c8da (patch)
treeed0caa6f429d5b388e9c9bacf23fd84b928291e5
parent6be37cc583454ee27587a79b6008e22c3cc1a763 (diff)
parent7c388dbd0b2c54b3d836c23ea43e2cee38de66a4 (diff)
downloadqemu-e01151de165070c25a1b202e9e2392950bd7c8da.zip
qemu-e01151de165070c25a1b202e9e2392950bd7c8da.tar.gz
qemu-e01151de165070c25a1b202e9e2392950bd7c8da.tar.bz2
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170727-pull-request' into staging
ui: keymap fixes for 2.10 # gpg: Signature made Thu 27 Jul 2017 15:00:06 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-20170727-pull-request: ps2: fix sending of PAUSE/BREAK scancodes ui: drop altgr and altgr_r QKeyCodes ps2: enable multimedia keys ui: add multimedia keys ui: update keymaps ui: move qemu_input_linux_to_qcode() ui: add next and prior keysyms Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/char/escc.c1
-rw-r--r--hw/input/adb.c1
-rw-r--r--hw/input/ps2.c6
-rw-r--r--include/ui/input.h1
-rw-r--r--qapi-schema.json31
-rw-r--r--ui/curses_keys.h2
-rw-r--r--ui/input-keymap.c169
-rw-r--r--ui/input-linux.c113
-rw-r--r--ui/keymaps.h1
-rw-r--r--ui/spice-input.c20
-rw-r--r--ui/vnc_keysym.h2
11 files changed, 222 insertions, 125 deletions
diff --git a/hw/char/escc.c b/hw/char/escc.c
index 89ae9eb..1aca564 100644
--- a/hw/char/escc.c
+++ b/hw/char/escc.c
@@ -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,
diff --git a/hw/input/adb.c b/hw/input/adb.c
index 43d3205..fcca3a8 100644
--- a/hw/input/adb.c
+++ b/hw/input/adb.c
@@ -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,
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 3ba05ef..9f057e4 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -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,10 +386,7 @@ 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,
[Q_KEY_CODE_ASTERISK] = 0x7c,
[Q_KEY_CODE_LESS] = 0x61,
[Q_KEY_CODE_SYSRQ] = 0x7f,
diff --git a/include/ui/input.h b/include/ui/input.h
index 3cfd0f3..c488585 100644
--- a/include/ui/input.h
+++ b/include/ui/input.h
@@ -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);
diff --git a/qapi-schema.json b/qapi-schema.json
index 9c6c3e1..dcc12c8 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4843,12 +4843,34 @@
# @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
+# 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',
@@ -4864,7 +4886,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:
diff --git a/ui/curses_keys.h b/ui/curses_keys.h
index e39ef9e..e9195a1 100644
--- a/ui/curses_keys.h
+++ b/ui/curses_keys.h
@@ -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 },
diff --git a/ui/input-keymap.c b/ui/input-keymap.c
index 8a1476f..0d9ddde 100644
--- a/ui/input-keymap.c
+++ b/ui/input-keymap.c
@@ -3,14 +3,149 @@
#include "ui/keymaps.h"
#include "ui/input.h"
+#include "standard-headers/linux/input.h"
+
+static int linux_to_qcode[KEY_CNT] = {
+ [KEY_ESC] = Q_KEY_CODE_ESC,
+ [KEY_1] = Q_KEY_CODE_1,
+ [KEY_2] = Q_KEY_CODE_2,
+ [KEY_3] = Q_KEY_CODE_3,
+ [KEY_4] = Q_KEY_CODE_4,
+ [KEY_5] = Q_KEY_CODE_5,
+ [KEY_6] = Q_KEY_CODE_6,
+ [KEY_7] = Q_KEY_CODE_7,
+ [KEY_8] = Q_KEY_CODE_8,
+ [KEY_9] = Q_KEY_CODE_9,
+ [KEY_0] = Q_KEY_CODE_0,
+ [KEY_MINUS] = Q_KEY_CODE_MINUS,
+ [KEY_EQUAL] = Q_KEY_CODE_EQUAL,
+ [KEY_BACKSPACE] = Q_KEY_CODE_BACKSPACE,
+ [KEY_TAB] = Q_KEY_CODE_TAB,
+ [KEY_Q] = Q_KEY_CODE_Q,
+ [KEY_W] = Q_KEY_CODE_W,
+ [KEY_E] = Q_KEY_CODE_E,
+ [KEY_R] = Q_KEY_CODE_R,
+ [KEY_T] = Q_KEY_CODE_T,
+ [KEY_Y] = Q_KEY_CODE_Y,
+ [KEY_U] = Q_KEY_CODE_U,
+ [KEY_I] = Q_KEY_CODE_I,
+ [KEY_O] = Q_KEY_CODE_O,
+ [KEY_P] = Q_KEY_CODE_P,
+ [KEY_LEFTBRACE] = Q_KEY_CODE_BRACKET_LEFT,
+ [KEY_RIGHTBRACE] = Q_KEY_CODE_BRACKET_RIGHT,
+ [KEY_ENTER] = Q_KEY_CODE_RET,
+ [KEY_LEFTCTRL] = Q_KEY_CODE_CTRL,
+ [KEY_A] = Q_KEY_CODE_A,
+ [KEY_S] = Q_KEY_CODE_S,
+ [K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DOWN] = Q_KEY_CODE_DOWN,
+ [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,
+
+ [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[] = {
[Q_KEY_CODE_SHIFT] = 0x2a,
[Q_KEY_CODE_SHIFT_R] = 0x36,
[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,
@@ -98,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,
@@ -133,14 +269,43 @@ 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,
+ [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,
};
static int number_to_qcode[0x100];
+int qemu_input_linux_to_qcode(unsigned int lnx)
+{
+ assert(lnx < KEY_CNT);
+ return linux_to_qcode[lnx];
+}
+
int qemu_input_key_value_to_number(const KeyValue *value)
{
if (value->type == KEY_VALUE_KIND_QCODE) {
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 49d52a6..9720333 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -16,119 +16,6 @@
#include <sys/ioctl.h>
#include "standard-headers/linux/input.h"
-static int linux_to_qcode[KEY_CNT] = {
- [KEY_ESC] = Q_KEY_CODE_ESC,
- [KEY_1] = Q_KEY_CODE_1,
- [KEY_2] = Q_KEY_CODE_2,
- [KEY_3] = Q_KEY_CODE_3,
- [KEY_4] = Q_KEY_CODE_4,
- [KEY_5] = Q_KEY_CODE_5,
- [KEY_6] = Q_KEY_CODE_6,
- [KEY_7] = Q_KEY_CODE_7,
- [KEY_8] = Q_KEY_CODE_8,
- [KEY_9] = Q_KEY_CODE_9,
- [KEY_0] = Q_KEY_CODE_0,
- [KEY_MINUS] = Q_KEY_CODE_MINUS,
- [KEY_EQUAL] = Q_KEY_CODE_EQUAL,
- [KEY_BACKSPACE] = Q_KEY_CODE_BACKSPACE,
- [KEY_TAB] = Q_KEY_CODE_TAB,
- [KEY_Q] = Q_KEY_CODE_Q,
- [KEY_W] = Q_KEY_CODE_W,
- [KEY_E] = Q_KEY_CODE_E,
- [KEY_R] = Q_KEY_CODE_R,
- [KEY_T] = Q_KEY_CODE_T,
- [KEY_Y] = Q_KEY_CODE_Y,
- [KEY_U] = Q_KEY_CODE_U,
- [KEY_I] = Q_KEY_CODE_I,
- [KEY_O] = Q_KEY_CODE_O,
- [KEY_P] = Q_KEY_CODE_P,
- [KEY_LEFTBRACE] = Q_KEY_CODE_BRACKET_LEFT,
- [KEY_RIGHTBRACE] = Q_KEY_CODE_BRACKET_RIGHT,
- [KEY_ENTER] = Q_KEY_CODE_RET,
- [KEY_LEFTCTRL] = Q_KEY_CODE_CTRL,
- [KEY_A] = Q_KEY_CODE_A,
- [KEY_S] = Q_KEY_CODE_S,
- [KEY_D] = Q_KEY_CODE_D,
- [KEY_F] = Q_KEY_CODE_F,
- [KEY_G] = Q_KEY_CODE_G,
- [KEY_H] = Q_KEY_CODE_H,
- [KEY_J] = Q_KEY_CODE_J,
- [KEY_K] = Q_KEY_CODE_K,
- [KEY_L] = Q_KEY_CODE_L,
- [KEY_SEMICOLON] = Q_KEY_CODE_SEMICOLON,
- [KEY_APOSTROPHE] = Q_KEY_CODE_APOSTROPHE,
- [KEY_GRAVE] = Q_KEY_CODE_GRAVE_ACCENT,
- [KEY_LEFTSHIFT] = Q_KEY_CODE_SHIFT,
- [KEY_BACKSLASH] = Q_KEY_CODE_BACKSLASH,
- [KEY_102ND] = Q_KEY_CODE_LESS,
- [KEY_Z] = Q_KEY_CODE_Z,
- [KEY_X] = Q_KEY_CODE_X,
- [KEY_C] = Q_KEY_CODE_C,
- [KEY_V] = Q_KEY_CODE_V,
- [KEY_B] = Q_KEY_CODE_B,
- [KEY_N] = Q_KEY_CODE_N,
- [KEY_M] = Q_KEY_CODE_M,
- [KEY_COMMA] = Q_KEY_CODE_COMMA,
- [KEY_DOT] = Q_KEY_CODE_DOT,
- [KEY_SLASH] = Q_KEY_CODE_SLASH,
- [KEY_RIGHTSHIFT] = Q_KEY_CODE_SHIFT_R,
- [KEY_LEFTALT] = Q_KEY_CODE_ALT,
- [KEY_SPACE] = Q_KEY_CODE_SPC,
- [KEY_CAPSLOCK] = Q_KEY_CODE_CAPS_LOCK,
- [KEY_F1] = Q_KEY_CODE_F1,
- [KEY_F2] = Q_KEY_CODE_F2,
- [KEY_F3] = Q_KEY_CODE_F3,
- [KEY_F4] = Q_KEY_CODE_F4,
- [KEY_F5] = Q_KEY_CODE_F5,
- [KEY_F6] = Q_KEY_CODE_F6,
- [KEY_F7] = Q_KEY_CODE_F7,
- [KEY_F8] = Q_KEY_CODE_F8,
- [KEY_F9] = Q_KEY_CODE_F9,
- [KEY_F10] = Q_KEY_CODE_F10,
- [KEY_NUMLOCK] = Q_KEY_CODE_NUM_LOCK,
- [KEY_SCROLLLOCK] = Q_KEY_CODE_SCROLL_LOCK,
- [KEY_KP0] = Q_KEY_CODE_KP_0,
- [KEY_KP1] = Q_KEY_CODE_KP_1,
- [KEY_KP2] = Q_KEY_CODE_KP_2,
- [KEY_KP3] = Q_KEY_CODE_KP_3,
- [KEY_KP4] = Q_KEY_CODE_KP_4,
- [KEY_KP5] = Q_KEY_CODE_KP_5,
- [KEY_KP6] = Q_KEY_CODE_KP_6,
- [KEY_KP7] = Q_KEY_CODE_KP_7,
- [KEY_KP8] = Q_KEY_CODE_KP_8,
- [KEY_KP9] = Q_KEY_CODE_KP_9,
- [KEY_KPMINUS] = Q_KEY_CODE_KP_SUBTRACT,
- [KEY_KPPLUS] = Q_KEY_CODE_KP_ADD,
- [KEY_KPDOT] = Q_KEY_CODE_KP_DECIMAL,
- [KEY_KPENTER] = Q_KEY_CODE_KP_ENTER,
- [KEY_KPSLASH] = Q_KEY_CODE_KP_DIVIDE,
- [KEY_KPASTERISK] = Q_KEY_CODE_KP_MULTIPLY,
- [KEY_F11] = Q_KEY_CODE_F11,
- [KEY_F12] = Q_KEY_CODE_F12,
- [KEY_RIGHTCTRL] = Q_KEY_CODE_CTRL_R,
- [KEY_SYSRQ] = Q_KEY_CODE_SYSRQ,
- [KEY_RIGHTALT] = Q_KEY_CODE_ALT_R,
- [KEY_HOME] = Q_KEY_CODE_HOME,
- [KEY_UP] = Q_KEY_CODE_UP,
- [KEY_PAGEUP] = Q_KEY_CODE_PGUP,
- [KEY_LEFT] = Q_KEY_CODE_LEFT,
- [KEY_RIGHT] = Q_KEY_CODE_RIGHT,
- [KEY_END] = Q_KEY_CODE_END,
- [KEY_DOWN] = Q_KEY_CODE_DOWN,
- [KEY_PAGEDOWN] = Q_KEY_CODE_PGDN,
- [KEY_INSERT] = Q_KEY_CODE_INSERT,
- [KEY_DELETE] = Q_KEY_CODE_DELETE,
- [KEY_LEFTMETA] = Q_KEY_CODE_META_L,
- [KEY_RIGHTMETA] = Q_KEY_CODE_META_R,
- [KEY_MENU] = Q_KEY_CODE_MENU,
-};
-
-static int qemu_input_linux_to_qcode(unsigned int lnx)
-{
- assert(lnx < KEY_CNT);
- return linux_to_qcode[lnx];
-}
-
static bool linux_is_button(unsigned int lnx)
{
if (lnx < 0x100) {
diff --git a/ui/keymaps.h b/ui/keymaps.h
index 47d0613..8757465 100644
--- a/ui/keymaps.h
+++ b/ui/keymaps.h
@@ -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
diff --git a/ui/spice-input.c b/ui/spice-input.c
index 9185802..cda9976 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -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);
}
diff --git a/ui/vnc_keysym.h b/ui/vnc_keysym.h
index 7fa2bc1..e8a2ec7 100644
--- a/ui/vnc_keysym.h
+++ b/ui/vnc_keysym.h
@@ -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 */