summaryrefslogtreecommitdiff
path: root/keyboards/monarch/keymaps/via/keymap.c
diff options
context:
space:
mode:
authorjack <0x6A73@pm.me>2023-06-19 09:46:27 -0600
committerGitHub <noreply@github.com>2023-06-19 09:46:27 -0600
commitc4a67d3f3302f3096bb6b15921c9587643164ba9 (patch)
treebf10e469333ba42b708e76cfc085eb450d92359e /keyboards/monarch/keymaps/via/keymap.c
parent74fbd5a0313769655914166bc872d41461509bd3 (diff)
Remove encoder in-matrix workaround code (#20389)
Diffstat (limited to 'keyboards/monarch/keymaps/via/keymap.c')
-rw-r--r--keyboards/monarch/keymaps/via/keymap.c57
1 files changed, 11 insertions, 46 deletions
diff --git a/keyboards/monarch/keymaps/via/keymap.c b/keyboards/monarch/keymaps/via/keymap.c
index c70f9c213b..d83c8c92e1 100644
--- a/keyboards/monarch/keymaps/via/keymap.c
+++ b/keyboards/monarch/keymaps/via/keymap.c
@@ -23,70 +23,35 @@ 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_PGUP,
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_PGDN,
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_UP,
- KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT,
- KC_VOLD, KC_VOLU
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT_all(
QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_ON,
- _______, _______, _______, BL_TOGG, _______, BL_DOWN, BL_OFF, BL_UP,
- _______, _______
+ _______, _______, _______, BL_TOGG, _______, BL_DOWN, BL_OFF, BL_UP
),
[2] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______
+ _______, _______, _______, _______, _______, _______, _______, _______
),
[3] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______
+ _______, _______, _______, _______, _______, _______, _______, _______
)
};
-
-keyevent_t encoder_ccw = {
- .key = (keypos_t){.row = 5, .col = 0},
- .pressed = false,
- .type = KEY_EVENT
-};
-
-keyevent_t encoder_cw = {
- .key = (keypos_t){.row = 5, .col = 1},
- .pressed = false,
- .type = KEY_EVENT
+#ifdef ENCODER_MAP_ENABLE
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [1] = { ENCODER_CCW_CW(_______, _______) },
+ [2] = { ENCODER_CCW_CW(_______, _______) },
+ [3] = { ENCODER_CCW_CW(_______, _______) },
};
-
-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