-
-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
[Feature] Add keycode PDF(layer) to set the default layer in EEPROM #21881
[Feature] Add keycode PDF(layer) to set the default layer in EEPROM #21881
Conversation
modifying default_layer_state_set might be a simpler solution. |
Do you mean that having the user do persistence in I did it the way I did because I can envision a scenario where the user would like to have some kind of tentative layer switch keycode in one layer and a more committed switch in a special layer that needs more confirmation (like in Miryoku), and because of Via(l): a user can then switch the behaviour between the temporary switch and the permanent switch by changing the keycode. |
I would update * [`bool process_default_layer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/????????????????????????????????/quantum/process_keycode/process_default_layer.c#L22) but don't know what the squashed commit hash will look like. In that sense, the documentation update cannot be atomic along with the code. While looking at the surroundings of the documentation, I also found that the new |
Hmm. QMK CI failure
And the original definition is in ChibiOS so I'll have to rename the keycode. |
And now things should be pretty much OK. I've renamed the keycode to PDF, and edited the original post and the PR title to suit. |
This PR now depends on: to be merged first so it can work better for layers 8..31. Could a maintainer please add the awaiting_pr tag? Thank you! |
Thank you for your contribution! |
The PR dependency adding support for layers 8..31 has been changed to #22933 |
Thank you for your contribution! |
Thank you for your contribution! |
To make this potentially mergeable, could the conflicts be resolved please. (Or alternatively the |
cfc3dd1
to
33d1a26
Compare
Thank you for pinging me, @zvecr. I have updated my branch to current |
Thank you for your contribution! |
…24630) * [Feature] Add keycode PDF(layer) to set the default layer in EEPROM (#21881) * Apply suggestions from code review Co-authored-by: Nick Brassel <[email protected]> --------- Co-authored-by: Nebuleon <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
…mk#24630) * [Feature] Add keycode PDF(layer) to set the default layer in EEPROM (qmk#21881) * Apply suggestions from code review Co-authored-by: Nick Brassel <[email protected]> --------- Co-authored-by: Nebuleon <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
…mk#24630) * [Feature] Add keycode PDF(layer) to set the default layer in EEPROM (qmk#21881) * Apply suggestions from code review Co-authored-by: Nick Brassel <[email protected]> --------- Co-authored-by: Nebuleon <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
…mk#24630) * [Feature] Add keycode PDF(layer) to set the default layer in EEPROM (qmk#21881) * Apply suggestions from code review Co-authored-by: Nick Brassel <[email protected]> --------- Co-authored-by: Nebuleon <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
…mk#24630) * [Feature] Add keycode PDF(layer) to set the default layer in EEPROM (qmk#21881) * Apply suggestions from code review Co-authored-by: Nick Brassel <[email protected]> --------- Co-authored-by: Nebuleon <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
…mk#24630) * [Feature] Add keycode PDF(layer) to set the default layer in EEPROM (qmk#21881) * Apply suggestions from code review Co-authored-by: Nick Brassel <[email protected]> --------- Co-authored-by: Nebuleon <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
Description
This pull request introduces the
PDF(layer)
keycode, which acts likeDF(layer)
but sets the target layer in EEPROM with the existingset_single_persistent_default_layer
function. The second proposed name,PDF
, after the first which caused a name collision, stands for Persistent DeFault.The keycode occupies the part of the 16-bit QMK keycode space starting at
0x52E0
and goes on for 32 entries, each corresponding to one of the 32 layers. It is, likeDF
, compiled unlessNO_ACTION_LAYER
is defined.I have adjusted the core features and keyboards that have special processing for
DF
so that the same processing applies forPDF
:process_auto_mouse(uint16_t keycode, keyrecord_t* record)
, so that it does nothing;process_autocorrect_default_handler(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods)
, to excludePDF
from processing;bool music_mask_kb(uint16_t keycode)
undermoonlander
andplanck/ez
, so that the keycodes are excluded from music mode processing.The lint check is expected to fail here under either
moonlander
orplanck/ez
because the indentation style of theswitch
statement differs between the two and the linter only accepts one of them. I have preferred consistency within the surrounding code per the CONTRIBUTING document.Types of Changes
Checklist