Skip to content
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

[GMMK Pro] Fix unintentional taps to the volume keys when using the encoder #17129

Merged
merged 2 commits into from
Sep 24, 2022

Conversation

andrebrait
Copy link
Contributor

@andrebrait andrebrait commented May 17, 2022

Description

In a similar vein to #16830, this fixes the double-tapping or unintentional tapping of the volume keys when using the encoder, introduced in #16721.

While #16830 took care of fixing the behavior, it still kept the user encoder handling code in the default keymaps. I have removed it, since it's not necessary, given pro.c already contains the handling for the media keys (and in an even better way, since it can be more compatible when NKRO is enabled).

I took the time to look for any instances in which user layouts would end up having a different behavior due to #16721.
Some of them were:

  • Introducing a Volume Up/Down key tap where there was none, previously;
    • This happened when the user handled the encoder for other functions in encoder_update_user and then returned true
  • Double-tapping Volume Up/Down due to both the keyboard and user encoder functions both sending taps
    • This happened when the user would send a tap on their encoder_update_user implementation and then return true

I realize going about changing other people's code is not a good thing, but the code was effectively broken, so here it is.

I also took care of moving an outdated keymap into the ansi subdirectory and fixing a small typo in the docs. The whitespace-related changes were done by my text editor and I don't have time to undo them right now. If that's an issue, I'll try to push a new commit later to revert them.

Sign-off

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added documentation keymap via Adds via keymap and/or updates keyboard for via support labels May 17, 2022
@zvecr
Copy link
Member

zvecr commented May 17, 2022

Changing user keymaps requires sign-off from the affected users.

@zvecr zvecr added the breaking_change Changes that need to wait for a version increment label May 17, 2022
@andrebrait
Copy link
Contributor Author

@zvecr how is this a breaking change?

And ok. Should I add them all on this PR and ask them if they are okay with the change then?

@zvecr
Copy link
Member

zvecr commented May 17, 2022

@zvecr how is this a breaking change?

Its the label we use to manage PRs which touch user code, without prior sign-off. https://docs.qmk.fm/#/breaking_changes_instructions.

Should I add them all on this PR and ask them if they are okay with the change then?

Correct.

@andrebrait
Copy link
Contributor Author

@alexmarmon, @byungyoonc, @cedrikl, @coryginsberg, @Gigahawk, @hachetman, @JackKenney, @Jonavin (both ansi and iso), @zvuc, @mattgauf, @mike1808, @tguinan, @stickandgum, @WholesomeDucky, @willwm, @ViToni

My bad for spamming all of you, but essentially there is a breaking change that affects your keymaps and I'm fixing it. Just need you guys to check if the changes I made reflect the intent here (meaning keeping the behavior your keymaps had before #16721).

@coryginsberg
Copy link

@andrebrait My keymap keeps the default encoder settings so everything should be fine for my stuff.

@cedrikl
Copy link

cedrikl commented May 17, 2022

Default mapping for me as well if it breaks I'll fix it at that point. Thanks for letting us know.

@Jonavin
Copy link
Contributor

Jonavin commented May 17, 2022

Should be fine on my keymaps

@WholesomeDucky
Copy link

My keymap uses the encoder for scroll left/right anyway (at least I believe the version on GitHub does) so I'm completely good with this

@stickandgum
Copy link

I certainly use the encoder but don't know how to verify if this will break any specific functionality. With that said, I trust the community so feel free to modify my code as you see fit.

Thank you.

@tzarc
Copy link
Member

tzarc commented May 17, 2022

Added list of required sign-offs to the description.

@andrebrait
Copy link
Contributor Author

I certainly use the encoder but don't know how to verify if this will break any specific functionality. With that said, I trust the community so feel free to modify my code as you see fit.

Thank you.

You can pull the code from master and flash to your keyboard. As far as I can tell, before this PR, you'll always get a volume up/down tap in addition to whatever your code is doing. Best case scenario you'd get two taps to the same volume change button. I think you're using your encoder to scroll with mouse buttons. In this case you'd get a volume up/down every time you scrolled up/down.

@hachetman
Copy link

hachetman commented May 18, 2022

Hi, also default mapping for me. If anything breaks I will fix it.

@stickandgum
Copy link

Copy link

@tguinan tguinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me

@andrebrait
Copy link
Contributor Author

https://github.com/qmk/qmk_firmware/blob/master/keyboards/gmmk/pro/ansi/keymaps/stickandgum/keymap.c#:~:text=%23ifdef%20ENCODER_ENABLE,endif%20//ENCODER_ENABLE Is the section - I will likely be able to test this over the weekend.

@stickandgum yeah, you'd definitely get a tap to KC_VOLU or KC_VOLU in addition to PgUp/PgDn (if holding CTRL) or horizontal mouse scrolling (if holding shift), or two taps to the volume keys if none.

@zvuc
Copy link

zvuc commented May 18, 2022

Just re-compiled firmware with the changed bit and tested encoders. Seems fine!

@byungyoonc
Copy link

LGTM, thanks for caring!

docs/feature_encoders.md Outdated Show resolved Hide resolved
@andrebrait
Copy link
Contributor Author

@alexmarmon @Gigahawk @JackKenney sorry to bother you, but I still need your blessing here 🙃

@JackKenney
Copy link

Looks good to me!

@Gigahawk
Copy link

@alexmarmon @Gigahawk @JackKenney sorry to bother you, but I still need your blessing here 🙃

LGTM, but I haven't tested it. Haven't had a reason to reflash my board. TY for the fix!

@andrebrait
Copy link
Contributor Author

@drashna @zvecr it seems the only sign-off missing is @alexmarmon, who seems to be active but unresponsive.

Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALso, because this targets user keymaps, this either needs to go to the develop branch (you can edit the title to change the target... weird yes, but that's how it handled), or you need each user to sign off on this change.

keyboards/gmmk/pro/rev1/ansi/keymaps/andrebrait/config.h Outdated Show resolved Hide resolved
Fixes some user layouts that were affected by e335d62 (qmk#16721
@andrebrait andrebrait changed the base branch from master to develop September 15, 2022 20:23
@andrebrait
Copy link
Contributor Author

ALso, because this targets user keymaps, this either needs to go to the develop branch (you can edit the title to change the target... weird yes, but that's how it handled), or you need each user to sign off on this change.

I switched the base branch to develop and resolved a conflict.

@andrebrait
Copy link
Contributor Author

@drashna let me know if this is good enough now

@drashna drashna requested a review from a team September 24, 2022 06:18
@drashna drashna merged commit 32204f4 into qmk:develop Sep 24, 2022
@andrebrait andrebrait deleted the keymap/andrebrait branch October 3, 2022 00:13
ramonimbao pushed a commit to ramonimbao/qmk_firmware that referenced this pull request Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change Changes that need to wait for a version increment keymap via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet