diff --git a/quantum/vial.c b/quantum/vial.c index 038614ecef..1723fe2052 100644 --- a/quantum/vial.c +++ b/quantum/vial.c @@ -46,6 +46,10 @@ _Static_assert(sizeof(vial_unlock_combo_rows) == sizeof(vial_unlock_combo_cols), #define VIAL_RAW_EPSIZE 32 +#ifndef VIAL_ENCODER_KEYCODE_DELAY +#define VIAL_ENCODER_KEYCODE_DELAY 10 +#endif + void vial_handle_cmd(uint8_t *msg, uint8_t length) { /* All packets must be fixed 32 bytes */ if (length != VIAL_RAW_EPSIZE) @@ -168,6 +172,9 @@ static void exec_keycode(uint16_t keycode) { action_exec((keyevent_t){ .key = (keypos_t){.row = VIAL_ENCODER_MATRIX_MAGIC, .col = VIAL_ENCODER_MATRIX_MAGIC}, .pressed = 1, .time = (timer_read() | 1) /* time should not be 0 */ }); +#if VIAL_ENCODER_KEYCODE_DELAY > 0 + wait_ms(VIAL_ENCODER_KEYCODE_DELAY); +#endif action_exec((keyevent_t){ .key = (keypos_t){.row = VIAL_ENCODER_MATRIX_MAGIC, .col = VIAL_ENCODER_MATRIX_MAGIC}, .pressed = 0, .time = (timer_read() | 1) /* time should not be 0 */ });