From 02aa76c2ba5df8db7c968d92959af2a7c35690a8 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 11 Mar 2014 12:15:39 +0100 Subject: input: key mapping helpers Add helper functions to translate KeyValue (qapi key representation) into other representations: traditional qemu key numbers, qapi key codes (Q_KEY_CODE_*) and scancode sequences. Signed-off-by: Gerd Hoffmann --- include/ui/input.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/ui/input.h b/include/ui/input.h index 4976f3da2c..010c903e80 100644 --- a/include/ui/input.h +++ b/include/ui/input.h @@ -35,6 +35,10 @@ InputEvent *qemu_input_event_new_key(KeyValue *key, bool down); void qemu_input_event_send_key(QemuConsole *src, KeyValue *key, bool down); void qemu_input_event_send_key_number(QemuConsole *src, int num, bool down); void qemu_input_event_send_key_qcode(QemuConsole *src, QKeyCode q, bool down); +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); InputEvent *qemu_input_event_new_btn(InputButton btn, bool down); void qemu_input_queue_btn(QemuConsole *src, InputButton btn, bool down); -- cgit v1.2.3-55-g7522