From 2b3dfd00b1d6a48376c317c88a26229533d22ad9 Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Thu, 7 Feb 2019 04:18:43 +0800 Subject: [PATCH] Catch dash symbol before event, remove trimming --- src/comfortable-swipe.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/comfortable-swipe.cpp b/src/comfortable-swipe.cpp index 9793a4f..e7643d4 100644 --- a/src/comfortable-swipe.cpp +++ b/src/comfortable-swipe.cpp @@ -343,12 +343,12 @@ namespace util { * fingers */ const char* GESTURE_SWIPE_BEGIN_REGEX_PATTERN = - "^\\s*" // trim start of string - "\\s+event\\d+" // event + "^" // start of string + "[ -]event\\d+" // event "\\s+GESTURE_SWIPE_BEGIN" // gesture "\\s+\\S+" // timestamp "\\s+(\\d+)" // fingers - "\\s*$" // trim end of string + "$" // end of string ; /** @@ -360,12 +360,12 @@ namespace util { * fingers */ const char* GESTURE_SWIPE_END_REGEX_PATTERN = - "^\\s*" // trim start of string - "\\s+event\\d+" // event + "^" // start of string + "[ -]event\\d+" // event "\\s+GESTURE_SWIPE_END" // gesture "\\s+\\S+" // timestamp "\\s+(\\d+)" // fingers - "\\s*$" // trim end of string + "$" // end of string ; // matches signed decimal numbers (eg. "6.02" "-1.1") @@ -383,14 +383,14 @@ namespace util { * fingers dx dy udx udy */ const char* GESTURE_SWIPE_UPDATE_REGEX_PATTERN = - "^\\s*" // trim start of string - "\\s+event\\d+" // event + "^" // start of string + "[ -]event\\d+" // event "\\s+GESTURE_SWIPE_UPDATE" // gesture "\\s+\\S+" // timestamp "\\s+(\\d+)" // fingers "\\s+" CF_NUMBER_DIVISION // speed (dx/dy) "\\s+\\(" CF_NUMBER_DIVISION "\\s+unaccelerated\\)" // unaccelerated speed (udx/udy) - "\\s*$" // trim end of string + "$" // end of string ; // delete macros