From 11c7fa7fa602704d9673ea59c575f58777008d93 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 21 May 2014 13:28:32 +0200 Subject: input: add qemu_input_key_number_to_qcode Signed-off-by: Gerd Hoffmann --- ui/input-keymap.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ui/input-keymap.c') diff --git a/ui/input-keymap.c b/ui/input-keymap.c index 6da4495..4c4f0d0 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -129,7 +129,7 @@ static const int qcode_to_number[] = { [Q_KEY_CODE_MAX] = 0, }; -static int number_to_qcode[0xff]; +static int number_to_qcode[0x100]; int qemu_input_key_value_to_number(const KeyValue *value) { @@ -141,7 +141,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_number_to_qcode(uint8_t nr) { static int first = true; @@ -155,11 +155,16 @@ int qemu_input_key_value_to_qcode(const KeyValue *value) } } + return number_to_qcode[nr]; +} + +int qemu_input_key_value_to_qcode(const KeyValue *value) +{ if (value->kind == KEY_VALUE_KIND_QCODE) { return value->qcode; } else { assert(value->kind == KEY_VALUE_KIND_NUMBER); - return number_to_qcode[value->number]; + return qemu_input_key_number_to_qcode(value->number); } } -- cgit v1.1 From 86846bfe64a0104df081226711804b8517258108 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 21 May 2014 13:54:32 +0200 Subject: input: keymap: add meta keys Signed-off-by: Gerd Hoffmann --- ui/input-keymap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui/input-keymap.c') diff --git a/ui/input-keymap.c b/ui/input-keymap.c index 4c4f0d0..5d29935 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -13,6 +13,8 @@ static const int qcode_to_number[] = { [Q_KEY_CODE_CTRL] = 0x1d, [Q_KEY_CODE_CTRL_R] = 0x9d, + [Q_KEY_CODE_META_L] = 0xdb, + [Q_KEY_CODE_META_R] = 0xdc, [Q_KEY_CODE_MENU] = 0xdd, [Q_KEY_CODE_ESC] = 0x01, -- cgit v1.1