From 169f8dc788a6d752481e1a6a03c34e446914d38b Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Sat, 18 Apr 2020 02:23:32 +0800 Subject: [PATCH] Do mousedown only for buttons 1 to 3 --- comfortable_swipe/gesture/mouse_hold_gesture.cpp | 4 ++-- defaults.conf | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/comfortable_swipe/gesture/mouse_hold_gesture.cpp b/comfortable_swipe/gesture/mouse_hold_gesture.cpp index d44b7ba..4e58580 100644 --- a/comfortable_swipe/gesture/mouse_hold_gesture.cpp +++ b/comfortable_swipe/gesture/mouse_hold_gesture.cpp @@ -63,7 +63,7 @@ namespace comfortable_swipe::gesture { // eg. MOUSE DOWN hold3 mouse1 std::printf("MOUSE DOWN hold%d %s\n", this->fingers, mouseinput); - if (button != 0) + if (1 <= button && button <= 3) { // send mouse down on associated button xdo_mouse_down(this->xdo, CURRENTWINDOW, button); @@ -81,7 +81,7 @@ namespace comfortable_swipe::gesture if (button != -1) { std::printf("MOUSE UP hold%d %s\n", this->fingers, mouseinput); - if (button != 0) + if (1 <= button && button <= 3) { // send mouse up on associated button xdo_mouse_up(this->xdo, CURRENTWINDOW, button); diff --git a/defaults.conf b/defaults.conf index bf5ee7a..3df55d4 100644 --- a/defaults.conf +++ b/defaults.conf @@ -64,6 +64,7 @@ threshold = 0.0 ############################# # Experimental: MOUSE HOLD # ############################# + # (1: left click, 2: middle click, 3: right click, 4: wheel up, 5: wheel down) # Uncomment to hold a mouse button on 3/4 fingers