diff options
author | Wilba <Jason.S.Williams@gmail.com> | 2022-07-21 09:53:42 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-21 09:53:42 +1000 |
commit | 4efe6330c49f076b9c01d3f609dea0cd9f9b0214 (patch) | |
tree | 9912d19826b3b148d98e71c3e78bed8e32a0366e /quantum/via.c | |
parent | 493d422406da72acf4f9b1fad098ebbb6454163e (diff) |
VIA Encoder Map Support (#17734)
Diffstat (limited to 'quantum/via.c')
-rw-r--r-- | quantum/via.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/quantum/via.c b/quantum/via.c index d2ef0862cc..37e2046a10 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -397,6 +397,18 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { dynamic_keymap_set_buffer(offset, size, &command_data[3]); break; } +#ifdef ENCODER_MAP_ENABLE + case id_dynamic_keymap_get_encoder: { + uint16_t keycode = dynamic_keymap_get_encoder(command_data[0], command_data[1], command_data[2] != 0); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_encoder: { + dynamic_keymap_set_encoder(command_data[0], command_data[1], command_data[2] != 0, (command_data[3] << 8) | command_data[4]); + break; + } +#endif default: { // The command ID is not known // Return the unhandled state |