aboutsummaryrefslogtreecommitdiff
path: root/src/keypress_thread.c
diff options
context:
space:
mode:
authorspv <spv@spv.sh>2025-12-05 14:13:15 -0500
committerspv <spv@spv.sh>2025-12-05 14:13:15 -0500
commita27e1fab1c383a1695bf116cfa5ac6fa08895edf (patch)
tree3925f1046fd926587c0ab557b8114f07ae1a632f /src/keypress_thread.c
parentdf3775e6bfceac4ab6249c43cffaa348b0eee984 (diff)
add config.h opt for ignoring release events
Diffstat (limited to 'src/keypress_thread.c')
-rw-r--r--src/keypress_thread.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/keypress_thread.c b/src/keypress_thread.c
index 4afbd61..9aaed9a 100644
--- a/src/keypress_thread.c
+++ b/src/keypress_thread.c
@@ -25,9 +25,13 @@ void keypress_thread(pid_t _light_pid) {
fseek(fp, 0, SEEK_END);
fread(&pressed_key, 1, sizeof(pressed_key), fp);
- if (pressed_key.value == 1) {
+ #if IGNORE_RELEASE
+ if (pressed_key.value != 0) {
on_press();
}
+ #else
+ on_press();
+ #endif
usleep(DEBOUNCE);
}