From cd4aa0a49d6fd4e9d7eb214df6fbd1b53f6f90f0 Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Thu, 2 May 2019 10:25:42 +0800 Subject: [PATCH] Defer patch to GESTURE_SWIPE_UPDATE regex pattern instead of modifying GESTURE_SWIPE_BEGIN --- lib/gesture/swipe_gesture.cpp | 3 ++- lib/gesture/swipe_gesture.regex.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gesture/swipe_gesture.cpp b/lib/gesture/swipe_gesture.cpp index a8ba7c9..973df0f 100644 --- a/lib/gesture/swipe_gesture.cpp +++ b/lib/gesture/swipe_gesture.cpp @@ -177,7 +177,8 @@ namespace comfortable_swipe::gesture else { // not swiping, check if swipe will begin - if (std::regex_match(line, matches, gesture_swipe_begin) != 0) + if (std::regex_match(line, matches, gesture_swipe_begin) != 0 + || std::regex_match(line, matches, gesture_swipe_update) != 0) { // assign necessary variables for swipe begin this->flag_swiping = true; diff --git a/lib/gesture/swipe_gesture.regex.cpp b/lib/gesture/swipe_gesture.regex.cpp index 08a8c96..7dd1d04 100644 --- a/lib/gesture/swipe_gesture.regex.cpp +++ b/lib/gesture/swipe_gesture.regex.cpp @@ -34,7 +34,7 @@ namespace comfortable_swipe::gesture const char* swipe_gesture::GESTURE_BEGIN_REGEX_PATTERN = "^" // start of string "[ -]event\\d+" // event - "\\s+GESTURE_SWIPE_(?:BEGIN|UPDATE)" // gesture, (UPDATE: patch for Microsoft Surface Pro Touchpad) + "\\s+GESTURE_SWIPE_BEGIN" // gesture "\\s+\\S+" // timestamp "\\s+(\\d+)" // fingers "\\s*$" // end of string