aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-11-27 18:24:29 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-03-05 09:50:18 +0100
commit43579403a3d67d6aab5ceb682dedae8fde85703c (patch)
treef5560754122f66e5949a0e4ec7b6501da07c79a0 /include
parentcd100328882ef6967918f3b47ddca9574bb31694 (diff)
input: mouse: add helpers functions to core
Likewise a bunch of helper functions to manage mouse button and movement events, again to make life easier for the ui code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/ui/input.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/ui/input.h b/include/ui/input.h
index 189f131b3b..c6f50c2440 100644
--- a/include/ui/input.h
+++ b/include/ui/input.h
@@ -8,6 +8,8 @@
#define INPUT_EVENT_MASK_REL (1<<INPUT_EVENT_KIND_REL)
#define INPUT_EVENT_MASK_ABS (1<<INPUT_EVENT_KIND_ABS)
+#define INPUT_EVENT_ABS_SIZE 0x8000
+
typedef struct QemuInputHandler QemuInputHandler;
typedef struct QemuInputHandlerState QemuInputHandlerState;
@@ -34,4 +36,16 @@ 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);
+InputEvent *qemu_input_event_new_btn(InputButton btn, bool down);
+void qemu_input_queue_btn(QemuConsole *src, InputButton btn, bool down);
+void qemu_input_update_buttons(QemuConsole *src, uint32_t *button_map,
+ uint32_t button_old, uint32_t button_new);
+
+int qemu_input_scale_axis(int value, int size_in, int size_out);
+InputEvent *qemu_input_event_new_move(InputEventKind kind,
+ InputAxis axis, int value);
+void qemu_input_queue_rel(QemuConsole *src, InputAxis axis, int value);
+void qemu_input_queue_abs(QemuConsole *src, InputAxis axis,
+ int value, int size);
+
#endif /* INPUT_H */