suggestion picker: a persistent layer to complement virtual keyboards like wvkbd
-rw-r--r--keyboard.c10
-rw-r--r--keyboard.h8
-rw-r--r--main.c16
3 files changed, 17 insertions, 17 deletions
diff --git a/keyboard.c b/keyboard.c
index 1cc50da..5de8d6b 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -65,7 +65,7 @@ kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y) {
}
void
-kbd_unpress_key(struct kbd *kb, uint32_t time) {
+kbd_unpress_key(struct kbd *kb) {
if (kb->last_press) {
kbd_draw_key(kb, kb->last_press, Unpress);
kb->last_press = NULL;
@@ -73,8 +73,8 @@ kbd_unpress_key(struct kbd *kb, uint32_t time) {
}
void
-kbd_release_key(struct kbd *kb, uint32_t time) {
- kbd_unpress_key(kb, time);
+kbd_release_key(struct kbd *kb) {
+ kbd_unpress_key(kb);
printf("\n");
// Important so autocompleted words get typed in time
fflush(stdout);
@@ -82,12 +82,12 @@ kbd_release_key(struct kbd *kb, uint32_t time) {
}
void
-kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y) {
+kbd_motion_key(struct kbd *kb, uint32_t x, uint32_t y) {
}
void
-kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) {
+kbd_press_key(struct kbd *kb, struct key *k) {
if (k->label) {
kb->last_press = k;
kbd_draw_key(kb, k, Press);
diff --git a/keyboard.h b/keyboard.h
index 7189d70..aae3004 100644
--- a/keyboard.h
+++ b/keyboard.h
@@ -54,10 +54,10 @@ void draw_over_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
void kbd_init(struct kbd *kb);
void kbd_init_suggs(struct key *suggs, uint32_t width, uint32_t height);
struct key *kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y);
-void kbd_unpress_key(struct kbd *kb, uint32_t time);
-void kbd_release_key(struct kbd *kb, uint32_t time);
-void kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y);
-void kbd_press_key(struct kbd *kb, struct key *k, uint32_t time);
+void kbd_unpress_key(struct kbd *kb);
+void kbd_release_key(struct kbd *kb);
+void kbd_motion_key(struct kbd *kb, uint32_t x, uint32_t y);
+void kbd_press_key(struct kbd *kb, struct key *k);
void kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type);
void kbd_draw_layout(struct kbd *kb);
void kbd_resize(struct kbd *kb);
diff --git a/main.c b/main.c
index c7d04ec..7ee6e0a 100644
--- a/main.c
+++ b/main.c
@@ -147,18 +147,18 @@ 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, time);
+ kbd_unpress_key(&keyboard);
next_key = kbd_get_key(&keyboard, touch_x, touch_y);
if (next_key) {
- kbd_press_key(&keyboard, next_key, time);
+ kbd_press_key(&keyboard, next_key);
}
}
void
wl_touch_up(void *data, struct wl_touch *wl_touch, uint32_t serial,
uint32_t time, int32_t id) {
- kbd_release_key(&keyboard, time);
+ kbd_release_key(&keyboard);
}
void
@@ -169,7 +169,7 @@ wl_touch_motion(void *data, struct wl_touch *wl_touch, uint32_t time,
touch_x = wl_fixed_to_int(x);
touch_y = wl_fixed_to_int(y);
- kbd_motion_key(&keyboard, time, touch_x, touch_y);
+ kbd_motion_key(&keyboard, touch_x, touch_y);
}
void
@@ -204,7 +204,7 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, uint32_t time,
cur_y = wl_fixed_to_int(surface_y);
if (cur_press) {
- kbd_motion_key(&keyboard, time, cur_x, cur_y);
+ kbd_motion_key(&keyboard, cur_x, cur_y);
}
}
@@ -215,15 +215,15 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
cur_press = state == WL_POINTER_BUTTON_STATE_PRESSED;
if (cur_press) {
- kbd_unpress_key(&keyboard, time);
+ kbd_unpress_key(&keyboard);
} else {
- kbd_release_key(&keyboard, time);
+ kbd_release_key(&keyboard);
}
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, time);
+ kbd_press_key(&keyboard, next_key);
}
}
}