Merge mouse and touch events

Both are handled the very same way on the device.
This commit is contained in:
Romain Vimont
2019-10-03 20:14:12 +02:00
parent 7e1d52c119
commit 6220456def
9 changed files with 48 additions and 133 deletions

View File

@@ -15,10 +15,11 @@
#define CONTROL_MSG_SERIALIZED_MAX_SIZE \
(3 + CONTROL_MSG_CLIPBOARD_TEXT_MAX_LENGTH)
#define POINTER_ID_MOUSE UINT64_C(-1);
enum control_msg_type {
CONTROL_MSG_TYPE_INJECT_KEYCODE,
CONTROL_MSG_TYPE_INJECT_TEXT,
CONTROL_MSG_TYPE_INJECT_MOUSE_EVENT,
CONTROL_MSG_TYPE_INJECT_TOUCH_EVENT,
CONTROL_MSG_TYPE_INJECT_SCROLL_EVENT,
CONTROL_MSG_TYPE_BACK_OR_SCREEN_ON,
@@ -49,10 +50,6 @@ struct control_msg {
struct {
enum android_motionevent_action action;
enum android_motionevent_buttons buttons;
struct position position;
} inject_mouse_event;
struct {
enum android_motionevent_action action;
uint64_t pointer_id;
struct position position;
float pressure;