From 288b04d74024355d5de99e54ccd3c1402f700df6 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:58:23 +0100 Subject: [PATCH] Fixed gesture detecting every finger combination instead of the specified one --- common/gesture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/gesture.c b/common/gesture.c index f929c7fc..6b012fcb 100644 --- a/common/gesture.c +++ b/common/gesture.c @@ -115,7 +115,7 @@ char *workspace_gesture_parse(const char *input, struct gesture *output) { // Split input type, fingers and directions list_t *split = split_string(input, ":"); - if (split->length < 1 || split->length > 3) { + if (split->length < 1 || split->length > 2) { return strformat( "expected [:][:direction], got %s", input); @@ -123,15 +123,15 @@ char *workspace_gesture_parse(const char *input, struct gesture *output) { // Parse optional arguments if (split->length > 1) { - char *next = split->items[1]; + char *next = split->items[0]; // Try to parse as finger count (1-9) if (strlen(next) == 1 && '1' <= next[0] && next[0] <= '9') { output->fingers = atoi(next); // Move to next if available - next = split->length == 3 ? split->items[2] : NULL; - } else if (split->length == 3) { + next = split->length == 2 ? split->items[1] : NULL; + } else if (split->length == 2) { // Fail here if argument can only be finger count return strformat("expected 1-9, got %s", next); }