enable via, unregister key on dynamic set

This commit is contained in:
Garretonzo 2024-10-23 11:29:14 -07:00
parent 453ec007c1
commit b7dfcedf59
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1 @@
VIA_ENABLE = yes

View File

@ -121,6 +121,8 @@ uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column)
void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode) {
if (layer >= DYNAMIC_KEYMAP_LAYER_COUNT || row >= MATRIX_ROWS || column >= MATRIX_COLS) return;
uint16_t prev_keycode = dynamic_keymap_get_keycode(layer, row, column);
unregister_code(prev_keycode);
void *address = dynamic_keymap_key_to_eeprom_address(layer, row, column);
// Big endian, so we can read/write EEPROM directly from host if we want
eeprom_update_byte(address, (uint8_t)(keycode >> 8));