diff --git a/comfortable-swipe-main.cpp b/comfortable-swipe-main.cpp index 5c72665..536099a 100644 --- a/comfortable-swipe-main.cpp +++ b/comfortable-swipe-main.cpp @@ -103,7 +103,7 @@ int main() { keyswipe.run(line.data()); } else if (mousehold.run(line.data())) { // only allow keyswipe gestures on mouse move - if (mousehold.button == MOUSE_MOVE) { + if (mousehold.button == MOUSE_NONE || mousehold.button == MOUSE_MOVE) { keyswipe.run(line.data()); } } diff --git a/tests/test_swipe.sh b/tests/test_swipe.sh index 978090b..c862b6b 100755 --- a/tests/test_swipe.sh +++ b/tests/test_swipe.sh @@ -89,12 +89,12 @@ OUTPUT="$(mktemp)" event7 GESTURE_SWIPE_END +2.19s 3 EOF -EXPECTED_OUTPUT="SWIPE left3 -SWIPE right3" +EXPECTED_OUTPUT="SWIPE left3 SWIPE right3" +ACTUAL_OUTPUT="$(cat "$OUTPUT" | xargs)" +echo "My output: $ACTUAL_OUTPUT" +echo "Expected: $EXPECTED_OUTPUT" -echo "$EXPECTED_OUTPUT" - -if [[ "$(cat "$OUTPUT")" == "$EXPECTED_OUTPUT" ]]; then +if [[ "$ACTUAL_OUTPUT" == "$EXPECTED_OUTPUT" ]]; then echo "PASSED" else echo "Did not match expected output:" >&2