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

[Keyboard] Overhaul ploopyco devices #22967

Merged
merged 9 commits into from
Mar 15, 2024

Conversation

drashna
Copy link
Member

@drashna drashna commented Jan 26, 2024

Description

  • Consolidates the code, since most of it was identical.
  • Improve drag scrolling
  • Consolidate docs

Types of Changes

  • Enhancement/optimization
  • Keyboard (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).

@drashna drashna requested a review from a team January 26, 2024 22:45
Comment on lines 138 to 142
#ifdef PLOOPY_DRAGSCROLL_INVERT
// Invert vertical scroll direction
mouse_report.v = -mouse_report.y;
mouse_report.v = -(int8_t)scroll_accumulated_v;
#else
mouse_report.v = mouse_report.y;
mouse_report.v = -(int8_t)scroll_accumulated_v;
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

-(int8_t)scroll_accumulated_v; is repeated twice here.

Trying this branch PLOOPY_DRAGSCROLL_INVERT has no effect due to this change.

Removing the negative modifier for the PLOOPY_DRAGSCROLL_INVERT ifdef branch seems to have the desired effect for me.

Copy link
Contributor

@chrishoage chrishoage Mar 9, 2024

Choose a reason for hiding this comment

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

This is perhaps personal preference, but I may expect both h and v values here to be inverted. It's unclear from the documentation if the PLOOPY_DRAGSCROLL_INVERT is only supposed to be for vertical scrolling. The reason I choose invert is to make the trackball scroll behavior to behave closer to a touch device when "moving" the plane around. The following gives me the behavior I would expect when turning on "invert"

#ifdef PLOOPY_DRAGSCROLL_INVERT
        mouse_report.h = -(int8_t)scroll_accumulated_h;
        mouse_report.v = (int8_t)scroll_accumulated_v;
#else
        mouse_report.h = (int8_t)scroll_accumulated_h;
        mouse_report.v = -(int8_t)scroll_accumulated_v;
#endif

Copy link
Member Author

Choose a reason for hiding this comment

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

Other than the unneeded negative for the non-inverted, I'd rather keep it as is, as that is closer to the older behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup understood it was like that before, I only left the second comment because I still wasn't able to get the "invert" behavior to be quite right.

Please feel free to leave it was it was!

Comment on lines 41 to 47
# ifndef PLOOPY_DPI_DEFAULT
# define PLOOPY_DPI_DEFAULT 1
# endif
#endif
#ifndef PLOOPY_DPI_DEFAULT
# define PLOOPY_DPI_DEFAULT 0
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

It's unclear if this is intentional or not, but PLOOPY_DPI_DEFAULT is repeated here twice

I don't think it has any ill effects, since PLOOPY_DPI_DEFAULT 1 will always be defined, or the keymap config.h will win, but that does mean that it appears PLOOPY_DPI_DEFAULT 0 may not be doing anything?

Copy link
Member Author

Choose a reason for hiding this comment

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

if the user specifies a dpi options array, the default isn't set. So to ensure that it has a default set.

Comment on lines 183 to 188
#ifndef PLOOPY_DRAGSCROLL_MOMENTARY
if (record->event.pressed)
#endif
{
is_drag_scroll = record->event.pressed;
#else
if (record->event.pressed) {
is_drag_scroll ^= 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this condition to be inverted. When I #define PLOOPY_DRAGSCROLL_MOMENTARY in my keymap config DRAG_SCROLL behaves as as toggled.

When I don't define PLOOPY_DRAGSCROLL_MOMENTARY it behaves as momentary

Copy link
Member Author

Choose a reason for hiding this comment

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

whoops, you're right

@keyboard-magpie
Copy link
Contributor

Is it worth stripping out the user keymaps too, whilst you're at it?

@github-actions github-actions bot added the via Adds via keymap and/or updates keyboard for via support label Mar 12, 2024
@drashna drashna merged commit 68e8d74 into qmk:develop Mar 15, 2024
3 checks passed
@drashna drashna deleted the keyboard/ploopy_consolidation branch March 15, 2024 05:15
mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Apr 4, 2024
mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Apr 4, 2024
mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Apr 15, 2024
whoisjordangarcia pushed a commit to whoisjordangarcia/qmk_firmware that referenced this pull request Jun 8, 2024
nuess0r pushed a commit to nuess0r/qmk_firmware that referenced this pull request Sep 8, 2024
Ardakilic pushed a commit to Ardakilic/qmk_firmware that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyboard 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.

4 participants