From 07acbb4d1db0606a37370e1a9f7b6b6f32f9d430 Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Fri, 17 Apr 2020 23:52:53 +0800 Subject: [PATCH] Use xdo_move_mouse_relative instead of screen capture --- lib/gesture/mouse_swipe_gesture.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/gesture/mouse_swipe_gesture.cpp b/lib/gesture/mouse_swipe_gesture.cpp index 82d328d..ce4cdc3 100644 --- a/lib/gesture/mouse_swipe_gesture.cpp +++ b/lib/gesture/mouse_swipe_gesture.cpp @@ -68,7 +68,7 @@ namespace comfortable_swipe::gesture } /** - * + * Run mouseup command on hold output. */ void mouse_swipe_gesture::do_mouseup(const char * mouseinput) { @@ -76,6 +76,11 @@ namespace comfortable_swipe::gesture if (mouse != -1) { std::printf("MOUSE UP hold%d %s\n", this->fingers, mouseinput); + if (mouse != 0) + { + // send mouse up to xdo + } + this->flag_mousedown = false; } } @@ -132,13 +137,10 @@ namespace comfortable_swipe::gesture swipe_gesture::update(); if (this->is_mousedown()) { - // ix, iy: mouse location on begin - // ux, uy: integral of mouse accelerations - xdo_move_mouse( + xdo_move_mouse_relative( this->xdo, - this->ix + this->ux, - this->iy + this->uy, - this->screen_num + this->udx, + this->udy ); }