Bugfix keyswipe gesture not passing test

This commit is contained in:
Rico Tiongson 2020-04-21 03:34:48 +08:00
parent de3f88c83c
commit f3de83fb83
2 changed files with 6 additions and 6 deletions

View File

@ -103,7 +103,7 @@ int main() {
keyswipe.run(line.data()); keyswipe.run(line.data());
} else if (mousehold.run(line.data())) { } else if (mousehold.run(line.data())) {
// only allow keyswipe gestures on mouse move // 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()); keyswipe.run(line.data());
} }
} }

View File

@ -89,12 +89,12 @@ OUTPUT="$(mktemp)"
event7 GESTURE_SWIPE_END +2.19s 3 event7 GESTURE_SWIPE_END +2.19s 3
EOF EOF
EXPECTED_OUTPUT="SWIPE left3 EXPECTED_OUTPUT="SWIPE left3 SWIPE right3"
SWIPE right3" ACTUAL_OUTPUT="$(cat "$OUTPUT" | xargs)"
echo "My output: $ACTUAL_OUTPUT"
echo "Expected: $EXPECTED_OUTPUT"
echo "$EXPECTED_OUTPUT" if [[ "$ACTUAL_OUTPUT" == "$EXPECTED_OUTPUT" ]]; then
if [[ "$(cat "$OUTPUT")" == "$EXPECTED_OUTPUT" ]]; then
echo "PASSED" echo "PASSED"
else else
echo "Did not match expected output:" >&2 echo "Did not match expected output:" >&2