diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-05-21 13:28:32 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2014-05-26 08:42:42 +0200 |
commit | 11c7fa7fa602704d9673ea59c575f58777008d93 (patch) | |
tree | 053b1fe2a41ed16511a8decb8c27ff93f06eeb96 /ui | |
parent | f5c0ab131265270c1e7852ec0d4e284a219d63d4 (diff) |
input: add qemu_input_key_number_to_qcode
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/input-keymap.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/input-keymap.c b/ui/input-keymap.c index 6da4495103..4c4f0d03a9 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); } } |