diff options
author | Philippe Voinov <philippevoinov@gmail.com> | 2017-05-05 15:39:52 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-05-11 09:42:16 +0200 |
commit | 9cfa7ab939f27ffca845ffb9a28c3fa1856c92e7 (patch) | |
tree | ca01d59a8b973d15eccc8521cd480dd98497f680 /include/ui | |
parent | 76d20ea0f1b26ebd5da2f5fb2fdf3250cde887bb (diff) | |
download | qemu-9cfa7ab939f27ffca845ffb9a28c3fa1856c92e7.zip |
ui: Support non-zero minimum values for absolute input axes
This patch refactors ui/input.c to support absolute axis
minimum values other than 0. All dependent calls to qemu_input_queue_abs
have been updated to explicitly supply 0 as the axis minimum value.
Signed-off-by: Philippe Voinov <philippevoinov@gmail.com>
Message-id: 20170505133952.29885-1-philippevoinov@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/input.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/ui/input.h b/include/ui/input.h index d06a12dd4c..3cfd0f3363 100644 --- a/include/ui/input.h +++ b/include/ui/input.h @@ -8,7 +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 +#define INPUT_EVENT_ABS_MIN 0x0000 +#define INPUT_EVENT_ABS_MAX 0x7FFF typedef struct QemuInputHandler QemuInputHandler; typedef struct QemuInputHandlerState QemuInputHandlerState; @@ -54,12 +55,14 @@ void qemu_input_update_buttons(QemuConsole *src, uint32_t *button_map, uint32_t button_old, uint32_t button_new); bool qemu_input_is_absolute(void); -int qemu_input_scale_axis(int value, int size_in, int size_out); +int qemu_input_scale_axis(int value, + int min_in, int max_in, + int min_out, int max_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); +void qemu_input_queue_abs(QemuConsole *src, InputAxis axis, int value, + int min_in, int max_in); void qemu_input_check_mode_change(void); void qemu_add_mouse_mode_change_notifier(Notifier *notify); |