-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Digitizer HID interface : absolute coordinates for mouse cursor #12851
Conversation
I tested it on windows but if someone could try on linux and macos, that would be great. Sometimes requirement for a functional report varies from one OS to another. |
It's needed, along with all the copyright headers for new files, too. |
Also, report information and HID endpoints need to be addded: And V-USB support should be added. |
I was piggybacking on the shared report for the digitizer report descriptor as well as for the endpoint. Should I had a full dedicated endpoint for digitizer with the option to DIGITIZER_SHARED_EP to use the shared endpoint? Regarding V-USB, it seems only the shared endpoint is an option. The joystick report was removed there pending some reorg of the endpoint management in V-USB (4226), and I'm not sure if this has happened yet. Do I had the digitizer reporting to the shared report of V-USB? |
V-USB now has a shared endpoint (#11103) so you should be good to add this (and joystick) 👍. |
So after a bit of a struggle I managed to get dedicated and shared endpoints working on lufa and chibios, and implemented the V-USB implementation. |
hmm, if I run qmk cformat on my branch, a lot of changes on files I didn't touch appear. This is not expected. Should I keep only changes on my files? |
Yeah, just keep the changes on files you touched. |
Use the Docker container to run clang-format, different versions seem to have different ideas of what "formatted" means. |
I saw the PR #12819 as well. Should I preemptively apply the fix for the digitizer report as well? |
3c07b73
to
a881d71
Compare
Just to sum up the outstanding issues :
|
It's a problem in the sense that clang-format's behaviour isn't consistent across versions. The solution for now is to always use the Docker container when running a format pass, otherwise when the PR is merged qmk-bot will open a subsequent PR to format it "properly".
I'd prefer to have it implemented the way Joystick is, without touching the
If that PR goes in first, yes. Otherwise, we'd ask for it to be rebased to apply the changes to the Digitizer stuff as well. |
6c2907c
to
e96d693
Compare
So I guess this PR is ready to be merged, at least feature-wise. The CI failed on something that was not related to the test and is failing to launch now, is there a way to relaunch it when it's not blocked by docker anymore? |
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.
Just a couple of things, otherwise, looks good
absolute screen coordinates. Tested on Pro Micro, Proton C and Blackpill.
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Add V-USB support
Fix formatting issues Move digitizer_task definition to the feature's base implementation file
pointer disappearing on Windows.
Co-authored-by: Ryan <fauxpark@gmail.com>
declaration being the interface to the implementation in each HW-specific usb implementation.
weak-linkage implementation for tests without usb implementation
5c46bbe
to
f66fdd8
Compare
I updated the changes requested, everything looks good now. |
…12851) * Add digitizer HID interface for setting the mouse cursor position at absolute screen coordinates. Tested on Pro Micro, Proton C and Blackpill. * Update docs/feature_digitizer.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update tmk_core/protocol/usb_descriptor.c Co-authored-by: Ryan <fauxpark@gmail.com> * Add missing copyrights Add V-USB support * Add support for digitizer dedicated endpoint for lufa and chibios. Fix formatting issues Move digitizer_task definition to the feature's base implementation file * Run cformat on modified files * Change digitizer report usage to Digitizer instead of Pen to avoid pointer disappearing on Windows. * Update tmk_core/protocol/vusb/vusb.c Co-authored-by: Ryan <fauxpark@gmail.com> * Run cformat from docker image * Remove send_digitizer from host_driver_t and instead rely on the declaration being the interface to the implementation in each HW-specific usb implementation. * Fix build : send_digitizer shouldn't be static in vusb and add weak-linkage implementation for tests without usb implementation * Change digitizer user interface to match pointing device's * Update documentation with new API Co-authored-by: a-chol <nothing@none.com> Co-authored-by: Ryan <fauxpark@gmail.com>
…12851) * Add digitizer HID interface for setting the mouse cursor position at absolute screen coordinates. Tested on Pro Micro, Proton C and Blackpill. * Update docs/feature_digitizer.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update tmk_core/protocol/usb_descriptor.c Co-authored-by: Ryan <fauxpark@gmail.com> * Add missing copyrights Add V-USB support * Add support for digitizer dedicated endpoint for lufa and chibios. Fix formatting issues Move digitizer_task definition to the feature's base implementation file * Run cformat on modified files * Change digitizer report usage to Digitizer instead of Pen to avoid pointer disappearing on Windows. * Update tmk_core/protocol/vusb/vusb.c Co-authored-by: Ryan <fauxpark@gmail.com> * Run cformat from docker image * Remove send_digitizer from host_driver_t and instead rely on the declaration being the interface to the implementation in each HW-specific usb implementation. * Fix build : send_digitizer shouldn't be static in vusb and add weak-linkage implementation for tests without usb implementation * Change digitizer user interface to match pointing device's * Update documentation with new API Co-authored-by: a-chol <nothing@none.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Digitizer HID interface : absolute coordinates for mouse cursor
Description
I've added a HID digitizer report enabled with DIGITIZER_ENABLE, which allows positioning the mouse cursor in absolute normalized screen coordinates.
This has been implemented for LUFA and Chibios backends, and tested on the pro micro as well as a blackpill and a proton c.
A few feature based on this could follow, such as mapping key coordinates to set the cursor position or a dichotomic positioning algorithm. Users can build mouse-based macros with this.
A handwired/onekey digitizer keymap has been added that rotates the cursor around the center of the screen.
Types of Changes
Checklist
I'll get around to check codestyle if needed in the coming days.