Fix keycode parameter extraction to match the new DD keycodes #13
+81
−38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
QMK has many keycodes with parameters, like
TO(layer)
orMT(mod, kc)
. Add macros for extracting the values of those parameters from the keycode, so that the bit allocation for those parameters can be performed in a single place where those macros are defined; then change various code that was extracting the parameters manually to use those macros.Macro names are based on the full
QK_xxx
range name; e.g., forMO(layer)
it isQK_MOMENTARY_GET_LAYER(kc)
.This change actually fixes several regressions introduced by DD keycode changes (mainly due to bit masks for layer-related keycodes no longer being correct).
Tested mostly by
make test:all
(which unfortunately does not cover much of the affected code); theTT()
bug was verified on some actual hardware. And probably not all problematic places have been found yet.Types of Changes
Issues Fixed or Closed by This PR
Checklist