mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-05-30 02:50:10 -04:00
Remove encoder in-matrix workaround code (#20389)
This commit is contained in:
parent
d2c00c35fa
commit
0f3a6ab637
87 changed files with 678 additions and 1678 deletions
|
@ -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][2] = {
|
||||
[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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue