diff --git a/caps2esc.c b/caps2esc.c index 87c3ee8..90714a0 100644 --- a/caps2esc.c +++ b/caps2esc.c @@ -1,6 +1,7 @@ #include #include +#include #include // clang-format off @@ -13,7 +14,8 @@ ctrl_down = {.type = EV_KEY, .code = KEY_LEFTCTRL, .value = 1}, capslock_down = {.type = EV_KEY, .code = KEY_CAPSLOCK, .value = 1}, esc_repeat = {.type = EV_KEY, .code = KEY_ESC, .value = 2}, ctrl_repeat = {.type = EV_KEY, .code = KEY_LEFTCTRL, .value = 2}, -capslock_repeat = {.type = EV_KEY, .code = KEY_CAPSLOCK, .value = 2}; +capslock_repeat = {.type = EV_KEY, .code = KEY_CAPSLOCK, .value = 2}, +syn = {.type = EV_SYN, .code = SYN_REPORT, .value = 0}; // clang-format on int equal(const struct input_event *first, const struct input_event *second) { @@ -55,6 +57,8 @@ int main(void) { continue; } write_event(&esc_down); + write_event(&syn); + usleep(20000); write_event(&esc_up); continue; }