diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-05-28 10:33:05 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-05-28 10:33:05 +0100 |
commit | 4aa23452e366790e6c50dea73c8bc5eea44e2f38 (patch) | |
tree | 7da474230a9909a6f79d3d05f4cdce3532e41051 /ui/input-keymap.c | |
parent | 9474ab1487cc70140099c8500ae4a1947ca966c1 (diff) | |
parent | 8977bd111f62035b675d41c432eb8b6bf6b86b0f (diff) | |
download | qemu-4aa23452e366790e6c50dea73c8bc5eea44e2f38.zip qemu-4aa23452e366790e6c50dea73c8bc5eea44e2f38.tar.gz qemu-4aa23452e366790e6c50dea73c8bc5eea44e2f38.tar.bz2 |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-9' into staging
input: add event routing and multiseat support.
input: misc bugfixes and minor improvements.
# gpg: Signature made Mon 26 May 2014 07:44:29 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found
* remotes/kraxel/tags/pull-input-9:
docs: add multiseat.txt
usb: add input routing support for tablet and keyboard
sdl: pass key event source to input layer
input: bind devices and input routing
input: switch hid mouse and tablet to the new input layer api.
input: switch hid keyboard to new input layer api.
input: keymap: add meta keys
input: add name to input_event_key_number
input: add qemu_input_key_number_to_qcode
input (curses): mask keycodes to remove modifier bits
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/input-keymap.c')
-rw-r--r-- | ui/input-keymap.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/input-keymap.c b/ui/input-keymap.c index 6da4495..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, @@ -129,7 +131,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 +143,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 +157,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); } } |