Skip to content

Commit

Permalink
started support for EV_REL events
Browse files Browse the repository at this point in the history
  • Loading branch information
vmonaco committed Sep 13, 2021
1 parent 7fb3f9e commit 7b94b28
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.c
Expand Up @@ -390,13 +390,13 @@ void main_loop() {
interrupt = 1;
}

// Ignore events other than EV_KEY
if (ev.type != EV_KEY) {
// Ignore key repeat events (1 is press, 0 is release, 2 is repeat)
if (ev.type == EV_KEY && ev.value == 2) {
continue;
}

// Ignore key repeat events (1 is press, 0 is release, 2 is repeat)
if (ev.type == EV_KEY && ev.value == 2) {
// Ignore events other than EV_KEY and EV_REL
if (ev.type != EV_KEY || ev.type != EV_REL) {
continue;
}

Expand All @@ -406,7 +406,7 @@ void main_loop() {
lower_bound = min(max(prev_release_time - current_time, 0), max_delay);
random_delay = random_between(lower_bound, max_delay);

// Buffer the keyboard event
// Buffer the event
n1 = malloc(sizeof(struct entry)); /* Insert at the head. */
n1->time = current_time + (long) random_delay;
n1->iev = ev;
Expand Down

0 comments on commit 7b94b28

Please sign in to comment.