vial/encoders: add VIAL_ENCODER_KEYCODE_DELAY (10ms) delay to the tap
This commit is contained in:
parent
6e7e701982
commit
80e488bfae
@ -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 */
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user