From fcf8b804ed95a98561bd4c1d6c85604be0f7cc7b Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Mon, 3 Apr 2023 10:33:45 +0200 Subject: [Core] Refactor `keyevent_t` for 1ms timing resolution (#15847) --- keyboards/rate/pistachio_mp/keymaps/via/keymap.c | 6 ++++-- keyboards/rate/pistachio_pro/keymaps/via/keymap.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'keyboards/rate') diff --git a/keyboards/rate/pistachio_mp/keymaps/via/keymap.c b/keyboards/rate/pistachio_mp/keymaps/via/keymap.c index 293da4f569..bee139ac93 100644 --- a/keyboards/rate/pistachio_mp/keymaps/via/keymap.c +++ b/keyboards/rate/pistachio_mp/keymaps/via/keymap.c @@ -87,7 +87,8 @@ void encoder_action_unregister(void) { keyevent_t encoder_event = (keyevent_t) { .key = encoder_state >> 1 ? ENC_CW : ENC_CCW, .pressed = false, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state = 0; action_exec(encoder_event); @@ -99,7 +100,8 @@ void encoder_action_register(uint8_t index, bool clockwise) { keyevent_t encoder_event = (keyevent_t) { .key = clockwise ? ENC_CW : ENC_CCW, .pressed = true, - .time = (timer_read() | 1) + .time = timer_read() + .type = KEY_EVENT }; encoder_state = (clockwise ^ 1) | (clockwise << 1); action_exec(encoder_event); diff --git a/keyboards/rate/pistachio_pro/keymaps/via/keymap.c b/keyboards/rate/pistachio_pro/keymaps/via/keymap.c index 3e390d442f..b5b8e3c440 100644 --- a/keyboards/rate/pistachio_pro/keymaps/via/keymap.c +++ b/keyboards/rate/pistachio_pro/keymaps/via/keymap.c @@ -135,7 +135,8 @@ void encoder_action_unregister(void) { keyevent_t encoder_event = (keyevent_t) { .key = encoder_state >> 1 ? ENC_CW : ENC_CCW, .pressed = false, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state = 0; action_exec(encoder_event); @@ -146,7 +147,8 @@ void encoder_action_register(uint8_t index, bool clockwise) { keyevent_t encoder_event = (keyevent_t) { .key = clockwise ? ENC_CW : ENC_CCW, .pressed = true, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state = (clockwise ^ 1) | (clockwise << 1); action_exec(encoder_event); -- cgit v1.2.3