Skip to content

Absolute mouse (touchscreen) HID support #620

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

Closed
ladyada opened this issue Feb 13, 2018 · 11 comments
Closed

Absolute mouse (touchscreen) HID support #620

ladyada opened this issue Feb 13, 2018 · 11 comments

Comments

@ladyada
Copy link
Member

ladyada commented Feb 13, 2018

Good one to do when we do multimedia key support (i believe we just need to craft the report API)

@ladyada ladyada added this to the 3.0 milestone Feb 13, 2018
@dhalbert
Copy link
Collaborator

dhalbert commented Apr 9, 2018

I did a little research on this. It may be an issue finding report descriptors that will work on all the major platforms. Paul Stoffregen has implemented touchscreen HID support for Teensy. The report descriptor he developed I think appears to work on Windows and Mac without external drivers; it may not work on Linux (or at least Raspbian). Some background here and in other forum posts: https://forum.pjrc.com/threads/32331-USB-HID-Touchscreen-support-needed

@dhalbert
Copy link
Collaborator

Latent support in #776, but not turned on. Needs more testing: it appears touchscreen and gamepad on the same HID endpoints might conflict on at least some platforms (Linux). Might need to wait for dynamic HID descriptors. Also current report descriptor (emulating a digitizer with stylus), does not necessarily seem to do the right thing with existing built-in drivers on all platforms.

@tannewt tannewt modified the milestones: 3.0, Long term Apr 24, 2018
@dhalbert
Copy link
Collaborator

Now available via user-defined HID descriptors.

@ladyada
Copy link
Member Author

ladyada commented Jun 16, 2021

woohoo 3 year old issue :D

@ATMakersBill
Copy link
Collaborator

While I understand how this solves the problem in theory, is there an example or doc that has the descriptor and hid code to process it?

@dhalbert
Copy link
Collaborator

Digitizer descriptor that worked on at least some systems:

https://github.com/adafruit/circuitpython/blob/6.3.x/tools/hid_report_descriptors.py#L341-L406

I don't know what Python library I was using with this, if any. I may have just seen whether the OS recognized it, as opposed to trying to send a report.

@Red-M
Copy link

Red-M commented Jun 16, 2021

For extra compatibility, these are the USB descriptors that QEMU/KVM use, https://github.com/qemu/qemu/blob/master/hw/usb/dev-hid.c#L486-L524

@bitboy85
Copy link

bitboy85 commented Jul 31, 2021

If anyone ends up here by google: I've created an example for absolute mouse here: https://gist.github.com/bitboy85/cdcd0e7e04082db414b5f1d23ab09005

Edit: Additional Info: I've testet on Linuxmint 20 and a dual screen setup. Coordinates 0,0 is the upper left corner of the left screen while 32767,32767 is the bottom right corner of the right screen. I've read somwhere that this behaviour on windows is different but i'm unable to test.
Note: There might be a small bug in the Linux USB handling for absolute mouse. I noticed the following: Set the pointer to lets say 1000, 1000. Works fine. Now move the pointer away with your normal mouse. Lets try to set the pointer again to 1000, 1000 and its not working. So it seems that two identical reports from an absolute mouse are not handled, even if the pointer is moved due to a different mechanic. Using different coordinates works fine again.

@hdo
Copy link

hdo commented Nov 26, 2021

Anyone have a working example with CircuitPython 7.0?
Unfortunately i can't get it working with CircuitPython 6.3 on PICO :-(

@ThomasAtBBTF
Copy link

I have one and will upload it here over the weekend.
BUT: It works on MacOS but not on IOS !
Did not check Windows and Linux.
I opened a feature request to Apple for making it work also under IOS.

@hdo
Copy link

hdo commented Nov 26, 2021

UPDATE:

This finally works for me (Windows 10):

#5461 (comment)


@ThomasAtBBTF

Any news?


That would be very helpful. Thanks.

I have one and will upload it here over the weekend. BUT: It works on MacOS but not on IOS ! Did not check Windows and Linux. I opened a feature request to Apple for making it work also under IOS.

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

No branches or pull requests

8 participants