1
0
Fork 0

Start moving towards introspection-based data retrieval (#18441)

This commit is contained in:
Nick Brassel 2022-09-30 03:25:55 +10:00 committed by GitHub
parent 8349ff1e8b
commit cbbb45c13f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 24 deletions

View file

@ -147,13 +147,13 @@ action_t action_for_keycode(uint16_t keycode) {
// translates key to keycode
__attribute__((weak)) uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) {
if (key.row < MATRIX_ROWS && key.col < MATRIX_COLS) {
return pgm_read_word(&keymaps[layer][key.row][key.col]);
return keycode_at_keymap_location(layer, key.row, key.col);
}
#ifdef ENCODER_MAP_ENABLE
else if (key.row == KEYLOC_ENCODER_CW && key.col < NUM_ENCODERS) {
return pgm_read_word(&encoder_map[layer][key.col][0]);
return keycode_at_encodermap_location(layer, key.col, true);
} else if (key.row == KEYLOC_ENCODER_CCW && key.col < NUM_ENCODERS) {
return pgm_read_word(&encoder_map[layer][key.col][1]);
return keycode_at_encodermap_location(layer, key.col, false);
}
#endif // ENCODER_MAP_ENABLE
return KC_NO;