Scale mouse events

The video screen size on the client may differ from the real device
screen size (e.g. the video stream may be scaled down). As a
consequence, mouse events must be scaled to match the real device
coordinates.

For this purpose, make the client send the video screen size along with
the absolute pointer location, and the server scale the location to
match the real device size before injecting mouse events.
This commit is contained in:
Romain Vimont
2018-01-22 16:50:08 +01:00
parent 11a60e5767
commit 8984c1a7c4
13 changed files with 246 additions and 96 deletions

View File

@@ -6,6 +6,7 @@
#include "android/input.h"
#include "android/keycodes.h"
#include "common.h"
#define CONTROL_EVENT_QUEUE_SIZE 64
#define SERIALIZED_EVENT_MAX_SIZE 33
@@ -32,12 +33,10 @@ struct control_event {
struct {
enum android_motionevent_action action;
enum android_motionevent_buttons buttons;
Sint32 x;
Sint32 y;
struct point point;
} mouse_event;
struct {
Sint32 x;
Sint32 y;
struct point point;
Sint32 hscroll;
Sint32 vscroll;
} scroll_event;