diff options
| -rw-r--r-- | src/config.h | 2 | ||||
| -rw-r--r-- | src/keypress_thread.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h index b958706..7eeff32 100644 --- a/src/config.h +++ b/src/config.h @@ -19,4 +19,6 @@ /* cat `echo $BACKLIGHT_FILE | sed 's/brightness/max_brightness/g'` */ #define MAX_BRIGHTNESS 255 +#define IGNORE_RELEASE 1 + #endif 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); } |
