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

Add dragscroll combo option for Ploopy devices. #24876

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

luluco250
Copy link

Description

This PR adds an option for Ploopy devices with the DRAG_SCROLL key to allow it to be both held or toggled (combining both momentary and toggled scroll).

The way it can be used is by tapping the key for toggling drag scroll or holding it for momentary drag scroll.

This can be enabled by setting #define PLOOPY_DRAGSCROLL_COMBO (defaults to not defined), the threshold can be customized by setting #define PLOOPY_DRAGSCROLL_COMBO_THRESHOLD <float value> (defaults to 0.5 if PLOOPY_DRAGSCROLL_COMBO is defined).

It works by checking if the user has exceeded the threshold while the key is being held:

  • If the threshold is exceeded, we cancel the toggle, but keep drag scrolling until the key is lifted.
  • Otherwise we toggle drag scrolling until the key is pressed again.

I have also included a short description of PLOOPY_DRAGSCROLL_COMBO in keyboards/ploopyco/readme.md following the style of the existing documentation.

I have worked on and tested this with my Ploopy Adept/Madromys, it seems to work well for my needs. I was directly inspired by this repo, but that was unmergeable so I chose to reimplement it on the latest master branch.

Types of Changes

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

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).

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.

Combo doesn't really feel like the right wording here, especially as "combos" is an existing feature. "tap toggle" is more accurate as the TT keys and oneshot "tap toggle" behavior function in the same way.

Additionally, I'm not sure that adding more keycodes for increasingly niche behavior at the kb level is the best idea. It would make sense to have separate MO and TG type keycode for dragscroll. But this sort of behavior feels like it is more appropriate for a user keymap.

@luluco250
Copy link
Author

luluco250 commented Jan 29, 2025

Combo doesn't really feel like the right wording here, especially as "combos" is an existing feature. "tap toggle" is more accurate as the TT keys and oneshot "tap toggle" behavior function in the same way.

I just copied the wording from the fork I found, I don't really mind changing the name.

Additionally, I'm not sure that adding more keycodes for increasingly niche behavior at the kb level is the best idea. It would make sense to have separate MO and TG type keycode for dragscroll. But this sort of behavior feels like it is more appropriate for a user keymap.

I can see the case for separate keycodes, though the existing code already has an option that changes the behavior to be momentary so I think it'd be less disruptive as a third option, no?

If we changed it to use separate keycodes then I'm guessing the user would have to use something like Tap-Hold to implement hybrid toggle/momentary? It'd be far easier for users to just enable an option I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants