summary refs log tree commit diff
path: root/keyboard.c
diff options
context:
space:
mode:
authorJohn Sullivan <jsullivan@csumb.edu>2022-01-09 21:25:58 -0800
committerJohn Sullivan <jsullivan@csumb.edu>2022-01-09 21:25:58 -0800
commit967ae61b806e6ebf95c396ec9922bd8051542009 (patch)
treea342d3919f6b51d7189e095db7e4491dbbd01d35 /keyboard.c
parent6958fd6ae1b1e29274907093d7fcfa54e7d4db14 (diff)
downloadsuggpicker-967ae61b806e6ebf95c396ec9922bd8051542009.tar.gz
project: rerun clang-format
TODO make a commit or PR hook for this
Diffstat (limited to 'keyboard.c')
-rw-r--r--keyboard.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/keyboard.c b/keyboard.c
index 36cff78..3c77a4b 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -166,17 +166,17 @@ kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y) {
 
 void
 kbd_unpress_key(struct kbd *kb, uint32_t time) {
-  bool unlatch_shift = false;
+	bool unlatch_shift = false;
 
 	if (kb->last_press) {
-    unlatch_shift = (kb->mods & Shift) == Shift;
+		unlatch_shift = (kb->mods & Shift) == Shift;
 
-    if (unlatch_shift) {
-      kb->mods ^= Shift;
-      zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0);
-    }
+		if (unlatch_shift) {
+			kb->mods ^= Shift;
+			zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0);
+		}
 
-    if (kb->last_press->type == Copy) {
+		if (kb->last_press->type == Copy) {
 			zwp_virtual_keyboard_v1_key(kb->vkbd, time, 127, // COMP key
 			                            WL_KEYBOARD_KEY_STATE_RELEASED);
 		} else {
@@ -190,14 +190,15 @@ kbd_unpress_key(struct kbd *kb, uint32_t time) {
 		} else if (unlatch_shift) {
 			kbd_draw_layout(kb);
 		} else {
-      kbd_draw_key(kb, kb->last_press, Unpress);
-    }
+			kbd_draw_key(kb, kb->last_press, Unpress);
+		}
 
 		kb->last_press = NULL;
 	}
 }
 
-void kbd_release_key(struct kbd *kb, uint32_t time) {
+void
+kbd_release_key(struct kbd *kb, uint32_t time) {
 	kbd_unpress_key(kb, time);
 	if (kb->print_intersect && kb->last_swipe) {
 		printf("\n");
@@ -208,7 +209,8 @@ 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_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y) {
 	// Output intersecting keys
 	// (for external 'swiping'-based accelerators).
 	if (kb->print_intersect) {
@@ -220,7 +222,7 @@ void kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y) {
 		struct key *intersect_key;
 		intersect_key = kbd_get_key(kb, x, y);
 		if (intersect_key &&
-		    (! kb->last_swipe || intersect_key->label != kb->last_swipe->label)) {
+		    (!kb->last_swipe || intersect_key->label != kb->last_swipe->label)) {
 			kbd_print_key_stdout(kb, intersect_key);
 			kb->last_swipe = intersect_key;
 			kbd_draw_key(kb, kb->last_swipe, Swipe);