-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Optimize layout changes by doing runtime mapping #2565
fix: Optimize layout changes by doing runtime mapping #2565
Conversation
petejohanson
commented
Oct 17, 2024
- To avoid tons of migration, extra flash writes, etc, we keep the keymaps and settings using a key position index that's tied to the stock layout, and at runtime mapping key positions as needed.
f728532
to
b431edc
Compare
@@ -247,12 +257,27 @@ int zmk_keymap_set_layer_binding_at_idx(zmk_keymap_layer_id_t layer_id, uint8_t | |||
|
|||
ASSERT_LAYER_VAL(layer_id, -EINVAL) | |||
|
|||
uint32_t *pos_map; | |||
int ret = zmk_physical_layouts_get_selected_to_stock_position_map(&pos_map); | |||
if (ret < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case isn't currently possible. Will it ever be possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than change the API later, I wanted to ensure we guard now in case things change later with how position maps get created.
19fe334
to
b5e6f31
Compare
b5e6f31
to
5e0b167
Compare
* To avoid tons of migration, extra flash writes, etc, we keep the keymaps and settings using a key position index that's tied to the stock layout, and at runtime mapping key positions as needed.
5e0b167
to
130276e
Compare
Have tested this on a 75% with a split backspace layout, and on my revxlp, no issues. Also had testing on BakenekoGo with two layouts. |