about summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-06-24 11:10:18 -0400
committerZach DeCook <zachdecook@librem.one>2022-06-24 11:10:18 -0400
commit213187bbf419e847c50d49d0d1299935cbcd087f (patch)
treec9b4d76edcbb8622c72e8af57cf99143edc0eca9 /main.c
parent534808211f04779ef87848f2b67daee333420bb3 (diff)
downloadsuggpicker-213187bbf419e847c50d49d0d1299935cbcd087f.tar.gz
suggpicker: Allow changing mind about which one you want to pick
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/main.c b/main.c
index cf2ed9f..8dd7810 100644
--- a/main.c
+++ b/main.c
@@ -147,12 +147,7 @@ wl_touch_down(void *data, struct wl_touch *wl_touch, uint32_t serial,
 	touch_x = wl_fixed_to_int(x);
 	touch_y = wl_fixed_to_int(y);
 
-	kbd_unpress_key(&keyboard);
-
-	next_key = kbd_get_key(&keyboard, touch_x, touch_y);
-	if (next_key) {
-		kbd_press_key(&keyboard, next_key);
-	}
+	kbd_motion_key(&keyboard, touch_x, touch_y);
 }
 
 void
@@ -221,10 +216,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
 	}
 
 	if (cur_press && cur_x >= 0 && cur_y >= 0) {
-		next_key = kbd_get_key(&keyboard, cur_x, cur_y);
-		if (next_key) {
-			kbd_press_key(&keyboard, next_key);
-		}
+		kbd_motion_key(&keyboard, cur_x, cur_y);
 	}
 }