-
-
Notifications
You must be signed in to change notification settings - Fork 42.4k
Tap mod swap magic #18353
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
Tap mod swap magic #18353
Conversation
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.
Did you look at another implementation of basically the same thing in #9126?
One thing that looks strange in the resulting API is that keycode_config()
remaps the embedded basic keycodes in the passed value, but does not remap the embedded mod bits in some of those keycodes, therefore the conversion performed by this function ends up incomplete. Maybe a more consistent API would include that conversion too (e.g., rename the existing keycode_config()
to uint8_t basic_keycode_config(uint8_t keycode)
, and then implement uint16_t keycode_config(uint16_t keycode)
in terms of basic_keycode_config()
and mod_config()
; also remove the mod_config()
calls from action_for_keycode()
). Although I'm not 100% sure about this part.
Thanks for the correction. Yah, that's makes sense. |
Signed-off-by: Osamu Aoki <osamu@debian.org>
11a16f3
to
a88c71c
Compare
I don't understand why "bootmagic config" is used to describe "magic" in the original source code. I don't see this expression elsewhere. My new comment followed sigprof's text thus use "magic" |
Hmmm... I now guess why "boot" in "bootmagic". Magic is persistent and boot time default. It has little or nothing in common with "BOOTMAGIC LITE" ESC-power-on programming. Still confusing. |
Because bootmagic also controlled a lot of this functionality, too. However, because it is too easy to accidentally trigger, we removed the bootmagic code to do this completely. (a LOT of tickets of "why are these keys switched?!?!") |
I see. But if so, why we use persistent memory to store magic. For me, MAGIC_SWAP_FOO feature is useful as a temporary work around when I plugged in to a machine with some special input handling. We can program QMK default map for our persistent preference anyway if you programmed it. For end user products, they probably add DIP switch to set it. I now see this persistent variables for magic is defined in bootmagic. Why not making this keymap_config struct as a simple global variable. This is easily done by adding a compiler flag with a few lines of code so keeping backward compatibility option is easily implemented. So no one get confused if you accidentally change magic swap setting. Re-plug keyboard will always reset magic swap settings. |
Signed-off-by: Osamu Aoki <osamu@debian.org>
Signed-off-by: Osamu Aoki <osamu@debian.org>
Hi, Applied extra patch to address possible issues: I think all these can be squashed |
The standard practice in QMK is to squash commits when merging a PR, so you don't need to worry about that — use separate commits if it's easier for you. |
Thank you for your contribution! |
Thank you for your contribution! |
This is for #18349
This worked for my case of combination of
At least some effort is made to avoid applying swap for non-keycode
Other case are included and made to be synmetrical.
Code may need some reformatting. (/* ...*/ comment)
This is more-or-less proof-of-concept patch.
So there may be shortcomings.
Description
See issue. #18349
Types of Changes
Issues Fixed or Closed by This PR
This solves #18349
Checklist