aboutsummaryrefslogtreecommitdiff
path: root/replay
diff options
context:
space:
mode:
authorSergio Lopez <slp@redhat.com>2023-05-26 13:29:21 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-05-28 13:08:25 +0400
commit2bfb10dff2a21e42708aa4aef4bb64e8e3674858 (patch)
treed73da317f73335d5c13bb715acbe492a56e04fa3 /replay
parent944ae6d9f17c3c6609f8d0832311b7a050d6c4b6 (diff)
downloadqemu-2bfb10dff2a21e42708aa4aef4bb64e8e3674858.zip
qemu-2bfb10dff2a21e42708aa4aef4bb64e8e3674858.tar.gz
qemu-2bfb10dff2a21e42708aa4aef4bb64e8e3674858.tar.bz2
ui: add the infrastructure to support MT events
Add the required infrastructure to support generating multitouch events. Signed-off-by: Sergio Lopez <slp@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230526112925.38794-3-slp@redhat.com>
Diffstat (limited to 'replay')
-rw-r--r--replay/replay-input.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/replay/replay-input.c b/replay/replay-input.c
index 1147e3d..bee3dbe 100644
--- a/replay/replay-input.c
+++ b/replay/replay-input.c
@@ -22,6 +22,7 @@ void replay_save_input_event(InputEvent *evt)
InputKeyEvent *key;
InputBtnEvent *btn;
InputMoveEvent *move;
+ InputMultiTouchEvent *mtt;
replay_put_dword(evt->type);
switch (evt->type) {
@@ -58,6 +59,14 @@ void replay_save_input_event(InputEvent *evt)
replay_put_dword(move->axis);
replay_put_qword(move->value);
break;
+ case INPUT_EVENT_KIND_MTT:
+ mtt = evt->u.mtt.data;
+ replay_put_dword(mtt->type);
+ replay_put_qword(mtt->slot);
+ replay_put_qword(mtt->tracking_id);
+ replay_put_dword(mtt->axis);
+ replay_put_qword(mtt->value);
+ break;
case INPUT_EVENT_KIND__MAX:
/* keep gcc happy */
break;
@@ -73,6 +82,7 @@ InputEvent *replay_read_input_event(void)
InputBtnEvent btn;
InputMoveEvent rel;
InputMoveEvent abs;
+ InputMultiTouchEvent mtt;
evt.type = replay_get_dword();
switch (evt.type) {
@@ -109,6 +119,14 @@ InputEvent *replay_read_input_event(void)
evt.u.abs.data->axis = (InputAxis)replay_get_dword();
evt.u.abs.data->value = replay_get_qword();
break;
+ case INPUT_EVENT_KIND_MTT:
+ evt.u.mtt.data = &mtt;
+ evt.u.mtt.data->type = (InputMultiTouchType)replay_get_dword();
+ evt.u.mtt.data->slot = replay_get_qword();
+ evt.u.mtt.data->tracking_id = replay_get_qword();
+ evt.u.mtt.data->axis = (InputAxis)replay_get_dword();
+ evt.u.mtt.data->value = replay_get_qword();
+ break;
case INPUT_EVENT_KIND__MAX:
/* keep gcc happy */
break;