Skip to content

Commit 2abf74d

Browse files
committed
Repeat Key: Overhaul implementation.
This commit substantially revises the implementation of Repeat Key to leverage keyrecord_t's .keycode field instead of setting the keypos for the intended key. The advantages of this are that * This eliminates the complication of temporarily setting the last layer state. * The keypos can now be set to the Repeat Key that's being pressed, as it should be, which is better for e.g. reactive RGB matrix animations. * We can now *set* the keycode to be repeated to any keycode, even those that are not necessarily mapped in the layout. * Most significantly, we can also use this same approach for Reverse Repeat, so that implementations and interaction with `process_record_user()` are analogous. The consistency makes it simpler to think about. The one minor downside is that it is now required that the Combos feature is enabled to use Repeat Key, since the critical .keycode field is only present when Combos are enabled. Additionally, I refactored the reverse key definitions to eliminate the need for defining a big table in keymap.c. Instead, a sensible set of reverse key definitions are used by default, and these may be added to or overridden by defining a `get_rev_repeat_key_keycode_user()` callback. Please see the updated documentation for full details: <https://getreuer.info/posts/keyboards/repeat-key>
1 parent a06164e commit 2abf74d

File tree

3 files changed

+362
-250
lines changed

3 files changed

+362
-250
lines changed

0 commit comments

Comments
 (0)