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

Adding the Ploopy Thumb #14668

Closed
wants to merge 26 commits into from
Closed

Adding the Ploopy Thumb #14668

wants to merge 26 commits into from

Conversation

ploopyco
Copy link
Contributor

@ploopyco ploopyco commented Oct 1, 2021

Added an implementation for the upcoming Ploopy Thumb.

Description

Just a bit of configuration stuff. Nothing new or groundbreaking; most of the code is a straight duplicate from the Ploopy Classic (keyboards/ploopyco/trackball).

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 keyboard keymap via Adds via keymap and/or updates keyboard for via support labels Oct 1, 2021
keyboards/ploopyco/trackball_thumb/rules.mk Outdated Show resolved Hide resolved
@drashna drashna requested a review from a team October 2, 2021 01:59
@drashna drashna requested review from fauxpark and a team October 23, 2021 06:09
keyboards/ploopyco/trackball_thumb/readme.md Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/rules.mk Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.c Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.c Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.c Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.c Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.c Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.c Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.h Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.h Outdated Show resolved Hide resolved
@ploopyco ploopyco requested a review from drashna December 7, 2021 13:04
Copy link
Member

@fauxpark fauxpark left a comment

Choose a reason for hiding this comment

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

.noci file can be deleted, as Travis isn't running anymore.

keyboards/ploopyco/trackball_thumb/rules.mk Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/rules.mk Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/rules.mk Outdated Show resolved Hide resolved
@drashna drashna self-assigned this Dec 8, 2021
@kevinlekiller
Copy link

kevinlekiller commented Dec 10, 2021

I'm having an issue where the up / down axis of the ball is reversed when building a firmware using this PR. The left / right axis is fine.

The default keymap also doesn't work properly on Linux (haven't tried other operating systems).

The default keymap is KC_BTN4, DPI_CONFIG, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN5

That puts the DPI on left side small lower button, the back button on the left side small top button and the forward button on the 3rd rightmost button.

This works as intended : KC_BTN5, KC_BTN4, KC_BTN1, KC_BTN3, KC_BTN2, DPI_CONFIG

@kevinlekiller
Copy link

Setting mouse_report.y to -mouse_report.y in pointing_device_task_kb() fixes the inverted trackball y axis, although I've not tested if it interferes with the drag scroll conditional block since I'm not using that.

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.

Setting mouse_report.y to -mouse_report.y in pointing_device_task_kb() fixes the inverted trackball y axis, although I've not tested if it interferes with the drag scroll conditional block since I'm not using that.

Sounds like it needs POINTING_DEVICE_INVERT_X defined in the keyboard's config.h file then.

ploopyco and others added 11 commits December 14, 2021 20:30
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
@ploopyco
Copy link
Contributor Author

Will squash...this is getting a bit out of hand.

@drashna
Copy link
Member

drashna commented Dec 14, 2021

Will squash...this is getting a bit out of hand.

No need, we squash when merging, so won't matter either way.

@ploopyco ploopyco requested a review from fauxpark December 15, 2021 19:40
Co-authored-by: Ryan <fauxpark@gmail.com>
@drashna drashna requested a review from fauxpark December 18, 2021 03:28
keyboards/ploopyco/trackball_thumb/readme.md Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/readme.md Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/readme.md Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/readme.md Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/rev1_001/config.h Outdated Show resolved Hide resolved
keyboards/ploopyco/trackball_thumb/trackball_thumb.h Outdated Show resolved Hide resolved
@Lenbok
Copy link
Contributor

Lenbok commented Dec 24, 2021

Trying to build this PR and it's not happy - what am I doing wrong here (I haven't even got to making changes)?

$ git describe
0.15.0-126-gdd28d4c103
$ make ploopyco/trackball_thumb/rev1_001:default
QMK Firmware 0.15.6
Making ploopyco/trackball_thumb/rev1_001 with keymap default

avr-gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: keyboards/ploopyco/opt_encoder.c                                                         [OK]
Compiling: keyboards/ploopyco/trackball_thumb/trackball_thumb.c                                     [OK]
Compiling: keyboards/ploopyco/trackball_thumb/keymaps/default/keymap.c                              [OK]
Compiling: quantum/quantum.c                                                                        [OK]
Compiling: quantum/send_string.c                                                                    [OK]
Compiling: quantum/bitwise.c                                                                        [OK]
Compiling: quantum/led.c                                                                            [OK]
Compiling: quantum/action.c                                                                         [OK]
Compiling: quantum/action_layer.c                                                                   [OK]
Compiling: quantum/action_macro.c                                                                   [OK]
Compiling: quantum/action_tapping.c                                                                 [OK]
Compiling: quantum/action_util.c                                                                    [OK]
Compiling: quantum/eeconfig.c                                                                       [OK]
Compiling: quantum/keyboard.c                                                                       [OK]
Compiling: quantum/keymap_common.c                                                                  [OK]
Compiling: quantum/keycode_config.c                                                                 [OK]
Compiling: quantum/sync_timer.c                                                                     [OK]
Compiling: quantum/logging/debug.c                                                                  [OK]
Compiling: quantum/logging/sendchar.c                                                               [OK]
Compiling: quantum/bootmagic/bootmagic_lite.c                                                       [OK]
Compiling: quantum/bootmagic/magic.c                                                                [OK]
Compiling: quantum/matrix_common.c                                                                  [OK]
Compiling: quantum/matrix.c                                                                         [OK]
Compiling: quantum/debounce/sym_defer_g.c                                                           [OK]
Compiling: quantum/main.c                                                                           [OK]
Compiling: quantum/mousekey.c                                                                       [OK]
Compiling: quantum/pointing_device.c                                                                [OK]
Compiling: quantum/pointing_device_drivers.c                                                        [OK]
Compiling: drivers/sensors/pmw3360.c                                                                [OK]
Compiling: quantum/process_keycode/process_magic.c                                                  [OK]
Compiling: quantum/process_keycode/process_grave_esc.c                                              [OK]
Compiling: quantum/process_keycode/process_space_cadet.c                                            [OK]
Compiling: platforms/avr/drivers/analog.c                                                           [OK]
Archiving: .build/obj_ploopyco_trackball_thumb_rev1_001_default/analog.o                            [OK]
Compiling: platforms/avr/drivers/spi_master.c                                                       [OK]
Archiving: .build/obj_ploopyco_trackball_thumb_rev1_001_default/spi_master.o                        [OK]
Assembling: platforms/avr/xprintf.S                                                                 [OK]
Compiling: platforms/avr/printf.c                                                                   [OK]
Compiling: tmk_core/protocol/host.c                                                                 [OK]
Compiling: tmk_core/protocol/report.c                                                               [OK]
Compiling: tmk_core/protocol/usb_device_state.c                                                     [OK]
Compiling: tmk_core/protocol/usb_util.c                                                             [OK]
Compiling: platforms/avr/platform.c                                                                 [OK]
Compiling: platforms/avr/suspend.c                                                                  [OK]
Compiling: platforms/avr/timer.c                                                                    [OK]
Compiling: platforms/avr/bootloader.c                                                               [OK]
Compiling: tmk_core/protocol/lufa/lufa.c                                                            [OK]
Compiling: tmk_core/protocol/usb_descriptor.c                                                       [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Class/Common/HIDParser.c                                       [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c                                        [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c                                [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c                                      [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c                                          [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c                                    [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c                                          [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c                                 [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c                                  [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/ConfigDescriptors.c                                       [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/DeviceStandardReq.c                                       [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/Events.c                                                  [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/HostStandardReq.c                                         [OK]
Compiling: lib/lufa/LUFA/Drivers/USB/Core/USBTask.c                                                 [OK]
Compiling: tmk_core/protocol/lufa/usb_util.c                                                        [OK]
Linking: .build/ploopyco_trackball_thumb_rev1_001_default.elf                                       [ERRORS]
 |
 | .build/obj_ploopyco_trackball_thumb_rev1_001_default/quantum/keyboard.o: In function `keyboard_init':
 | /home2/len/dev/qmk_firmware/quantum/keyboard.c:357: undefined reference to `encoder_init'
 | .build/obj_ploopyco_trackball_thumb_rev1_001_default/quantum/keyboard.o: In function `keyboard_task':
 | /home2/len/dev/qmk_firmware/quantum/keyboard.c:456: undefined reference to `encoder_read'
 | collect2: error: ld returned 1 exit status
 |
make[1]: *** [tmk_core/rules.mk:365: .build/ploopyco_trackball_thumb_rev1_001_default.elf] Error 1
Make finished with errors
make: *** [Makefile:478: ploopyco/trackball_thumb/rev1_001:default] Error 1

@Lenbok
Copy link
Contributor

Lenbok commented Dec 24, 2021

Looks like the most recent commit (dd28d4c) broke it, as the previous commit builds just fine for me. Shouldn't CI have picked that up?

I found all of the DPI settings too sensitive for my liking, and have seen other reports in reddit like this, so perhaps it's worth adding another value or two at the lower end as part of this PR.

@drashna
Copy link
Member

drashna commented Dec 24, 2021

Sorry, that was my bad. I have pushed a fix for it.

@drashna drashna requested review from tzarc and a team December 24, 2021 22:06
@fauxpark
Copy link
Member

Shouldn't CI have picked that up?

We don't have CI anymore, unfortunately. travis-ci.org is defunct, and the replacement doesn't really work for our needs.

Co-authored-by: Nick Brassel <nick@tzarc.org>
Copy link

@fhanrath fhanrath left a comment

Choose a reason for hiding this comment

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

I'm not sure if this is the correct place for this, but I own one of the devices and thought I'd be able to contribute my findings.

If you prefer an issue in your fork, I'll happily move my comments there.

# define OPT_THRES 150 // (0-1024) Threshold for actication
#endif
#ifndef OPT_SCALE
# define OPT_SCALE 1 // Multiplier for wheel

Choose a reason for hiding this comment

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

OPT_SCALE doesn't seem to do anything right now. Is this meant as a placeholder?

Same goes for OPT_THRES.

Copy link
Member

Choose a reason for hiding this comment

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

the scale used to do something, but that has changed, andt he code needs to be cleaned up (all of the ploopy devices need to be)

#ifdef PLOOPY_DRAGSCROLL_FIXED
pointing_device_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]);
#else
pointing_device_set_cpi(is_drag_scroll ? (dpi_array[keyboard_config.dpi_config] * PLOOPY_DRAGSCROLL_MULTIPLIER) : dpi_array[keyboard_config.dpi_config]);

Choose a reason for hiding this comment

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

I don't recognize any difference in speed while dragscrolling. Whatever values I set for PLOOPY_DRAGSCROLL_FIXED, PLOOPY_DRAGSCROLL_DPI or PLOOPY_DRAGSCROLL_MULTIPLIER, the dragscroll speed always seems to be the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this fixed?

Copy link

@fhanrath fhanrath Aug 18, 2022

Choose a reason for hiding this comment

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

No.
But I was able to integrate the changes from https://gist.github.com/patm1987/4ee78e8727bb4c5a1bbd5f2279b4e79d
into my Fork

Look at the _dragscroll_accumulator_x and _dragscroll_accumulator_y variables and how they are used.

This way I was able to set the dragscroll speed to my liking.

I'd be up to create a pull request to ploopyco if wanted. But I don't think the current state (of my changes) is remotely production ready, so I'd have to put in some work to make it cleaner and configurable for the user.

@stale
Copy link

stale bot commented Apr 16, 2022

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Jul 23, 2022
@drashna
Copy link
Member

drashna commented Jul 28, 2022

@ploopyco would you mind if I take over this PR?

@github-actions github-actions bot removed the stale Issues or pull requests that have become inactive without resolution. label Jul 29, 2022
@drashna drashna mentioned this pull request Aug 30, 2022
8 tasks
@drashna
Copy link
Member

drashna commented Aug 30, 2022

closing in favor of #18214

@drashna drashna closed this Aug 30, 2022
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.

9 participants