renovate/configure
main
master
f/handleHelp-varargs
wip/refactor-focus
f/clang-format-14
hardware/ploopy
examples/factory-firmware
f/driver/keyboardiohid
tmp/zagdul
jesse/space-cadet
jesse/wip/gd32-win
macros/rearchitecture
wip/rcm-stm32
f/keyboardio-model-100
charshift/configuration
pointing-device
f/samd-testbed
f/automatic-build-nightly
f/driver/keyboardiohid-orig
f/keymap-cache-redesign
tmp/parallel-cli
tmp/arduino-cli-pre-rebase
pr_host_keymap
f/testing-event-queue
testing
epan/testing/main
epan/testing/issue-840
epan/testing/readable
epan/build/justlib
epan/build/cmake
epan/testing/hello-simulator
device/normcore
atreus2/example-layout
v1.99.6
keyboardio-m100-MP-1
keyboardio-m100-DVT-3
keyboardio-m100-DVT-2
v1.99.5
v1.99.4
v1.99.3
v1.99.2
v1.99.1
v1.99.0
v1.98.0
v1.97.0
v1.94.0
v1.93.0
v1.92.0
v1.91.0
driver/bootloader-pre-rebase
shipped-model00-xmas
work-tip
${ noResults }
1 Commits (61153056159306b3fbf59e5e69cd354df43b6b9a)
Author | SHA1 | Message | Date |
---|---|---|---|
Gergely Nagy |
ab3b661cd5
|
Switch to activation-order for Layers
Previously, we used index-ordering for layers, meaning, we looked keys up based on the index of active layers. This turned out to be confusing, and in many cases, limiting, since we couldn't easily shift to a lower layer from a higher one. As such, index-ordering required careful planning of one's layers, and a deeper understanding of the system. This patch switches us to activation-ordering: the layer subsystem now keeps track of the order in which layers are activated, and uses that order to look keys up, instead of the index of layers. This makes it easier to understand how the system works, and allows us to shift to lower layers too. It does require a bit more resources, since we can't just store a bitmap of active layers, but need 32 bytes to store the order. We still keep the bitmap, to make `Layer.isActive()` fast: looking up a bit in the bitmap is more efficient than walking the active layer array, and this function is often used in cases where speed matters. As a side effect of the switch, a number of methods were deprecated, and similar ones with more appropriate names were introduced. See the updated `UPGRADING.md` document for more details. Plugins that used the deprecated methods were updated to use the new ones. Fixes #857. Signed-off-by: Gergely Nagy <algernon@keyboard.io> |
4 years ago |