-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ActiveModColor: Improve latency by caching interesting keys on layer …
…change Keys normally only change when switching layers, so instead of going through every key in every cycle to look for modifiers, do that once, when layers change (using the new `onLayerChange` event), and store the coordinates of keys we consider modifiers in an array (currently limited to 16 items). Then, when we want to highlight them, go over this array only, significantly reducing the work we need to do. In a typical case, on a full-size keyboard, one would have eight modifiers and a few layer keys, so instead of going through a hundred keys, we go through sixteen at most, but usually considerably less. This fixes #403, at the cost of noticeably higher PROGMEM and RAM use. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
- Loading branch information
Showing
2 changed files
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters