summaryrefslogtreecommitdiff
path: root/quantum/vial.c
diff options
context:
space:
mode:
authorIlya Zhuravlev <whatever@xyz.is>2021-02-08 18:13:38 -0500
committerIlya Zhuravlev <whatever@xyz.is>2021-02-08 18:13:38 -0500
commitb698a4bfda6911a17fa86d1ab1e89aa32b1cf7da (patch)
tree26f21593f930a6138433004cac86e16446b0d611 /quantum/vial.c
parenta02267f136a50b9ef7a117539360eba92b83c97a (diff)
vial/encoders: add VIAL_ENCODER_SIMPLE_TAP
Diffstat (limited to 'quantum/vial.c')
-rw-r--r--quantum/vial.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/quantum/vial.c b/quantum/vial.c
index 1723fe2052..8009a6613c 100644
--- a/quantum/vial.c
+++ b/quantum/vial.c
@@ -167,6 +167,13 @@ void vial_handle_cmd(uint8_t *msg, uint8_t length) {
uint16_t g_vial_magic_keycode_override;
static void exec_keycode(uint16_t keycode) {
+#ifdef VIAL_ENCODER_SIMPLE_TAP
+ register_code16(keycode);
+#if VIAL_ENCODER_KEYCODE_DELAY > 0
+ wait_ms(VIAL_ENCODER_KEYCODE_DELAY);
+#endif
+ unregister_code16(keycode);
+#else
g_vial_magic_keycode_override = keycode;
action_exec((keyevent_t){
@@ -178,6 +185,7 @@ 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 = 0, .time = (timer_read() | 1) /* time should not be 0 */
});
+#endif
}
void vial_encoder_update(uint8_t index, bool clockwise) {