diff options
Diffstat (limited to 'keyboards/rmi_kb/squishytkl/keymaps/via')
-rw-r--r-- | keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c | 46 | ||||
-rw-r--r-- | keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk | 1 |
2 files changed, 7 insertions, 40 deletions
diff --git a/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c b/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c index 2c33b4869c..ea11eadd08 100644 --- a/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c +++ b/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c @@ -22,46 +22,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_NO, KC_SPC, KC_NO, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, - KC_VOLU, KC_VOLD - ), + KC_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_NO, KC_SPC, KC_NO, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) }; -keyevent_t encoder_ccw = { - .key = (keypos_t){.row = 13, .col = 0}, - .pressed = false, - .type = KEY_EVENT +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) } }; - -keyevent_t encoder_cw = { - .key = (keypos_t){.row = 13, .col = 1}, - .pressed = false, - .type = KEY_EVENT -}; - -void matrix_scan_user(void) { - if (encoder_ccw.pressed) { - encoder_ccw.pressed = false; - encoder_ccw.time = timer_read(); - action_exec(encoder_ccw); - } - - if (encoder_cw.pressed) { - encoder_cw.pressed = false; - encoder_cw.time = timer_read(); - action_exec(encoder_cw); - } -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (clockwise) { - encoder_cw.pressed = true; - encoder_cw.time = timer_read(); - action_exec(encoder_cw); - } else { - encoder_ccw.pressed = true; - encoder_ccw.time = timer_read(); - action_exec(encoder_ccw); - } - return true; -} +#endif diff --git a/keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk b/keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk index 1e5b99807c..f1adcab005 100644 --- a/keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk +++ b/keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk @@ -1 +1,2 @@ VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes |