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>pull/363/head
parent
7214cc0d47
commit
38681b9681
Loading…
Reference in new issue