summaryrefslogtreecommitdiff
path: root/quantum/keymap_common.c
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-09-30 03:25:55 +1000
committerGitHub <noreply@github.com>2022-09-29 18:25:55 +0100
commitcbbb45c13f3de5ec28f62b6cd4a8b77143026500 (patch)
treeca148a07c46dc873d46f434f0aee4d4090139816 /quantum/keymap_common.c
parent8349ff1e8bbca7f41e9bc446ac10e8a9be81c698 (diff)
Start moving towards introspection-based data retrieval (#18441)
Diffstat (limited to 'quantum/keymap_common.c')
-rw-r--r--quantum/keymap_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 1d5ef9b403..5e8a043470 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -147,13 +147,13 @@ action_t action_for_keycode(uint16_t keycode) {
147// translates key to keycode 147// translates key to keycode
148__attribute__((weak)) uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { 148__attribute__((weak)) uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) {
149 if (key.row < MATRIX_ROWS && key.col < MATRIX_COLS) { 149 if (key.row < MATRIX_ROWS && key.col < MATRIX_COLS) {
150 return pgm_read_word(&keymaps[layer][key.row][key.col]); 150 return keycode_at_keymap_location(layer, key.row, key.col);
151 } 151 }
152#ifdef ENCODER_MAP_ENABLE 152#ifdef ENCODER_MAP_ENABLE
153 else if (key.row == KEYLOC_ENCODER_CW && key.col < NUM_ENCODERS) { 153 else if (key.row == KEYLOC_ENCODER_CW && key.col < NUM_ENCODERS) {
154 return pgm_read_word(&encoder_map[layer][key.col][0]); 154 return keycode_at_encodermap_location(layer, key.col, true);
155 } else if (key.row == KEYLOC_ENCODER_CCW && key.col < NUM_ENCODERS) { 155 } else if (key.row == KEYLOC_ENCODER_CCW && key.col < NUM_ENCODERS) {
156 return pgm_read_word(&encoder_map[layer][key.col][1]); 156 return keycode_at_encodermap_location(layer, key.col, false);
157 } 157 }
158#endif // ENCODER_MAP_ENABLE 158#endif // ENCODER_MAP_ENABLE
159 return KC_NO; 159 return KC_NO;