Use xdo_move_mouse_relative instead of screen capture

This commit is contained in:
Rico Tiongson 2020-04-17 23:52:53 +08:00
parent eb69b2fce4
commit 07acbb4d1d

View File

@ -68,7 +68,7 @@ namespace comfortable_swipe::gesture
} }
/** /**
* * Run mouseup command on hold output.
*/ */
void mouse_swipe_gesture::do_mouseup(const char * mouseinput) void mouse_swipe_gesture::do_mouseup(const char * mouseinput)
{ {
@ -76,6 +76,11 @@ namespace comfortable_swipe::gesture
if (mouse != -1) if (mouse != -1)
{ {
std::printf("MOUSE UP hold%d %s\n", this->fingers, mouseinput); std::printf("MOUSE UP hold%d %s\n", this->fingers, mouseinput);
if (mouse != 0)
{
// send mouse up to xdo
}
this->flag_mousedown = false; this->flag_mousedown = false;
} }
} }
@ -132,13 +137,10 @@ namespace comfortable_swipe::gesture
swipe_gesture::update(); swipe_gesture::update();
if (this->is_mousedown()) if (this->is_mousedown())
{ {
// ix, iy: mouse location on begin xdo_move_mouse_relative(
// ux, uy: integral of mouse accelerations
xdo_move_mouse(
this->xdo, this->xdo,
this->ix + this->ux, this->udx,
this->iy + this->uy, this->udy
this->screen_num
); );
} }