Skip to content

Commit

Permalink
Remove encoder in-matrix workaround code (qmk#20389)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpskenn committed Nov 5, 2023
1 parent 489ca86 commit 27c6242
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 201 deletions.
16 changes: 0 additions & 16 deletions keyboards/nora/v031/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#pragma once

/* Rotary Encoder */
#ifdef ENCODER_ENABLE
// Encoder triggers specific key matrix position,
// when turn knob clockwise or counterclockwise.
// This is handy to assign key codes by VIA.

// Number of endoder
#define ENCODERS 1

// Mappings of encoder rotation to key position in key matrix.
// --> k97, k47
#define ENCODERS_CW_KEY { { 7, 9 } }
#define ENCODERS_CCW_KEY { { 7, 4 } }

#endif

/* Audio */
#ifdef AUDIO_ENABLE
#define AUDIO_PIN C6
Expand Down
3 changes: 0 additions & 3 deletions keyboards/nora/v031/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@
{"label": "", "matrix": [4, 5], "x":9.75, "y":4, "w":1.5},
{"label": "", "matrix": [9, 5], "x":11.25, "y":4},
{"label": "", "matrix": [4, 6], "x":12.25, "y":4, "w":1.5},

{"label": "", "matrix": [4, 7], "x":7, "y":5},
{"label": "", "matrix": [9, 7], "x":8, "y":5}
]
}
}
Expand Down
21 changes: 7 additions & 14 deletions keyboards/nora/v031/keymaps/jpskenn/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,56 +85,49 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, XXXXXXX, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
C_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_SCLN, XXXXXXX, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_MINS, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, DM_PLY1, XXXXXXX, XXXXXXX, DM_PLY2, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LOPT, KC_LCMD, SP_LOW, KC_BSPC, KC_ESC, KC_ENT, SP_RAI, GUI_IME, KC_ROPT,
KC_VOLD, KC_VOLU
KC_LOPT, KC_LCMD, SP_LOW, KC_BSPC, KC_ESC, KC_ENT, SP_RAI, GUI_IME, KC_ROPT
),
[_WIN] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_LWIN, KC_LALT, _______, _______, _______, _______, _______, A_GRV, KC_APP,
_______, _______
KC_LWIN, KC_LALT, _______, _______, _______, _______, _______, A_GRV, KC_APP
),
[_NUM] = LAYOUT(
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSLS, KC_PSLS, KC_PSLS, KC_PAST, KC_PMNS, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, XXXXXXX, _______,
_______, _______, SP_NLOW, _______, _______, _______, _______, KC_P0, KC_PDOT,
_______, _______
_______, _______, SP_NLOW, _______, _______, _______, _______, KC_P0, KC_PDOT
),
[_LOWER] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, KC_TILD, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_RAISE] = LAYOUT(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_SCLN, KC_QUOT,
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______,
_______, _______, _______, KC_F12, _______, _______, _______, _______, _______,
_______, _______
_______, _______, _______, KC_F12, _______, _______, _______, _______, _______
),
[_NUM_LOWER] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, XXXXXXX, XXXXXXX, KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, XXXXXXX, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
C_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_SCLN, XXXXXXX, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_MINS, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, DM_PLY1, XXXXXXX, XXXXXXX, DM_PLY2, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LOPT, KC_LCMD, _______, KC_BSPC, KC_ESC, KC_ENT, _______, GUI_IME, KC_ROPT,
_______, _______
KC_LOPT, KC_LCMD, _______, KC_BSPC, KC_ESC, KC_ENT, _______, GUI_IME, KC_ROPT
),
[_ADJUST] = LAYOUT(
DM_RSTP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
DM_RSTP, MAC, WIN, NUM, _______, _______, _______, _______, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, IND_TOG, RGB_RMOD, KC_INS,
KC_CAPS, AU_TOGG, MU_TOGG, MU_NEXT, AU_PREV, AU_NEXT, _______, _______, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_TOG, RGB_MOD, VERSION,
_______, CK_TOGG, CK_RST, CK_DOWN, CK_UP, _______, DM_REC1, _______, _______, DM_REC2, NUM, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS,
_______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
};

Expand Down
6 changes: 5 additions & 1 deletion keyboards/nora/v031/keymaps/jpskenn_re/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#define RGB_MATRIX_LED_COUNT 65

#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#undef ENABLE_RGB_MATRIX_MULTISPLASH
36 changes: 22 additions & 14 deletions keyboards/nora/v031/keymaps/jpskenn_re/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,59 +87,67 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, XXXXXXX, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
C_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_SCLN, XXXXXXX, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_MINS, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, DM_PLY1, XXXXXXX, XXXXXXX, DM_PLY2, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LOPT, GUI_EN, SP_LOW, KC_BSPC, KC_ESC, KC_ENT, SP_RAI, GUI_JA, KC_ROPT,
KC_VOLD, KC_VOLU
KC_LOPT, GUI_EN, SP_LOW, KC_BSPC, KC_ESC, KC_ENT, SP_RAI, GUI_JA, KC_ROPT
),
[_WIN] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_LWIN, KC_LALT, _______, _______, _______, _______, _______, A_GRV, KC_APP,
_______, _______
KC_LWIN, KC_LALT, _______, _______, _______, _______, _______, A_GRV, KC_APP
),
[_NUM] = LAYOUT(
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSLS, KC_PSLS, KC_PSLS, KC_PAST, KC_PMNS, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, XXXXXXX, _______,
_______, _______, SP_NLOW, _______, _______, _______, _______, KC_P0, KC_PDOT,
_______, _______
_______, _______, SP_NLOW, _______, _______, _______, _______, KC_P0, KC_PDOT
),
[_LOWER] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, KC_TILD, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_RAISE] = LAYOUT(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_SCLN, KC_QUOT,
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______,
_______, _______, _______, KC_F12, _______, _______, _______, _______, _______,
_______, _______
_______, _______, _______, KC_F12, _______, _______, _______, _______, _______
),
[_NUM_LOWER] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, XXXXXXX, XXXXXXX, KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, XXXXXXX, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
C_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_SCLN, XXXXXXX, KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_MINS, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, DM_PLY1, XXXXXXX, XXXXXXX, DM_PLY2, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LOPT, KC_LCMD, _______, KC_BSPC, KC_ESC, KC_ENT, _______, GUI_IME, KC_ROPT,
_______, _______
KC_LOPT, KC_LCMD, _______, KC_BSPC, KC_ESC, KC_ENT, _______, GUI_IME, KC_ROPT
),
[_ADJUST] = LAYOUT(
DM_RSTP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
DM_RSTP, MAC, WIN, NUM, _______, _______, _______, _______, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, IND_TOG, BIND_TOG, KC_INS,
KC_CAPS, AU_TOGG, MU_TOGG, MU_NEXT, AU_PREV, AU_NEXT, _______, _______, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_TOG, RGB_MOD, VERSION,
_______, CK_TOGG, CK_RST, CK_DOWN, CK_UP, _______, DM_REC1, _______, _______, DM_REC2, NUM, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS,
_______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
};

//------------------------------------------------------------------------------
// Rotary Encoder with VIA
//------------------------------------------------------------------------------
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_MAC] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD) },
[_WIN] = { ENCODER_CCW_CW(_______, _______) },
[_NUM] = { ENCODER_CCW_CW(_______, _______) },
[_LOWER] = { ENCODER_CCW_CW(_______, _______) },
[_RAISE] = { ENCODER_CCW_CW(_______, _______) },
[_NUM_LOWER] = { ENCODER_CCW_CW(_______, _______) },
[_ADJUST] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

uint16_t key_timer;

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
Expand Down
1 change: 1 addition & 0 deletions keyboards/nora/v031/keymaps/jpskenn_re/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ VIA_ENABLE = yes
DYNAMIC_MACRO_ENABLE = yes

ENCODER_ENABLE = yes
ENCODER_MAP_ENABLE = yes
Loading

0 comments on commit 27c6242

Please sign in to comment.