-
-
Notifications
You must be signed in to change notification settings - Fork 40k
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 ps2_mouse pointing device #22532
base: develop
Are you sure you want to change the base?
Conversation
I'm so excited to see this PR. Thanks for pushing this along @joh! From my experience with Trackpoint, the ability to change the sensitivity registers seems like the most critical tuning parameter I'd like to somehow retain, whatever the method -- since the native scaling in the trackpoint itself operates before too much other gain is applied. |
6af7bd3
to
30e6986
Compare
Thank you for your contribution! |
Status: waiting for review :) |
Thank you for your contribution! |
Status: waiting for review |
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.
A couple of issues I found while trying to compile.
Also, as mentioned on discord, it may be best to simply rip out the entire ps2 implementation wholesale, and migrate all of the code over
The code migration should now be complete. PR Lint complains about missing licenses for some keyboards that were ported over to pointing device. I've been using this as my daily driver for some time, no issues on my hardware (RP2040 + SK8707 trackpoint module) . The remaining work is documentation and perhaps testing on additional hardware. It would be great to get the code reviewed before proceeding with the docs :) |
If PS2_{CLOCK,DATA}_PIN is undefined, use POINTING_DEVICE_{SCLK,SDIO}_PIN.
I have now migrated and reworked the documentation, so this should be good to go for review. Also tested successfully on ATmega32U4 with USART. |
Description
Migrate ps2_mouse to the pointing device framework.
POINTING_DEVICE_DRIVER=ps2_mouse
). This effectively removesPS2_MOUSE_ENABLE
. Many PS2_MOUSE features have been replaced by pointing device equivalents (see table below).drivers/sensors/ps2_mouse.[ch]
, together with the rest of the pointing device code.ps2_mouse_pointing_device_{get,set}_cpi()
implementations use counts/mm instead of counts/inch, since this is the unit employed by the PS/2 mouse protocol.The code has been tested on RP2040 with
PS2_DRIVER=vendor
and ATmega32U4 withPS2_DRIVER=usart
using a SK8707 trackpoint.To be completed
PS2_MOUSE
and what features are in use.PS2_MOUSE
features have pointing device replacements, and which features need to be retained.Keyboards using
PS2_MOUSE
featureFrom discussions on Discord, there seems to be a consensus to move
PS2_MOUSE
over to pointing device, since the code is very much overlapping. A first step is then to compile a list of keyboards currently usingPS2_MOUSE
, to get an overview over where and how the feature is used.A simple
git grep PS2_MOUSE_ENABLE keyboards/
reveals that there are only a handful of keyboards in the qmk codebase using the feature. Below I have compiled a list of them, and noted which features are in use and why.buzzard/rev1:
evyd13/gh80_3700:
frobiac/blackbowl:
handwired/108key_trackpoint:
PS2_DRIVER = usart
handwired/promethium:
handwired/trackpoint:
PS2_DRIVER = usart
pierce:
PS2_MOUSE
features and pointing device equivalents:A lot of the
PS2_MOUSE
features listed above have pointing device equivalents, but not all.PS2_MOUSE
PS2_MOUSE_SCROLL_MASK
PS2_MOUSE_ENABLE_SCROLLING
PS2_MOUSE_USE_2_1_SCALING
PS2_MOUSE_INIT_DELAY
pointing_device_init_user()
?PS2_MOUSE_[XYV]_MULTIPLIER
pointing_device_set_cpi()
?PS2_MOUSE_SCROLL_DIVISOR_[HV]
PS2_MOUSE_SCROLL_BTN_*
PS2_MOUSE_INVERT_BUTTONS
PS2_MOUSE_INVERT_[XY]
POINTING_DEVICE_INVERT_[XY]
PS2_MOUSE_INVERT_[HV]
PS2_MOUSE_SCROLL_BTN_*
PS2_MOUSE_ROTATE
POINTING_DEVICE_ROTATION_*
PS2_MOUSE_SCROLL_BTN_*
pointing_device_task_user()
, example in docsPS2_MOUSE_SEND
PS2_MOUSE_USE_REMOTE_MODE
PS2_MOUSE_DEBUG_{RAW,HID}
POINTING_DEVICE_DEBUG
ps2_mouse_init_user()
pointing_device_init_user()
ps2_mouse_moved_user()
pointing_device_task_user()
ps2_mouse_set_resolution()
pointing_device_set_cpi()
ps2_mouse_{enable,disable}_data_reporting()
ps2_mouse_set_{remote,stream}_mode()
ps2_mouse_set_scaling_{1_1,2_1}()
ps2_mouse_set_sample_rate()
Types of Changes
Checklist