Defer patch to GESTURE_SWIPE_UPDATE regex pattern instead of modifying GESTURE_SWIPE_BEGIN

This commit is contained in:
Rico Tiongson 2019-05-02 10:25:42 +08:00
parent 43fe2bb9b3
commit cd4aa0a49d
2 changed files with 3 additions and 2 deletions

View File

@ -177,7 +177,8 @@ namespace comfortable_swipe::gesture
else else
{ {
// not swiping, check if swipe will begin // 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 // assign necessary variables for swipe begin
this->flag_swiping = true; this->flag_swiping = true;

View File

@ -34,7 +34,7 @@ namespace comfortable_swipe::gesture
const char* swipe_gesture::GESTURE_BEGIN_REGEX_PATTERN = const char* swipe_gesture::GESTURE_BEGIN_REGEX_PATTERN =
"^" // start of string "^" // start of string
"[ -]event\\d+" // event "[ -]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+\\S+" // timestamp
"\\s+(\\d+)" // fingers "\\s+(\\d+)" // fingers
"\\s*$" // end of string "\\s*$" // end of string