Skip to content

Absolute mouse (touchscreen) HID support #620

Closed

Description

@ladyada

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

Activity

  1. added this to the 3.0 milestone on Feb 13, 2018
  2. dhalbert commented on Apr 9, 2018

    @dhalbert
    Collaborator

    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

  3. dhalbert commented on Apr 24, 2018

    @dhalbert
    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.

  4. modified the milestones: 3.0, Long term on Apr 24, 2018
  5. dhalbert commented on Jun 15, 2021

    @dhalbert
    Collaborator

    Now available via user-defined HID descriptors.

  6. ladyada commented on Jun 16, 2021

    @ladyada
    MemberAuthor

    woohoo 3 year old issue :D

  7. ATMakersBill commented on Jun 16, 2021

    @ATMakersBill
    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?

  8. dhalbert commented on Jun 16, 2021

    @dhalbert
    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.

  9. Red-M commented on Jun 16, 2021

    @Red-M

    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

  10. bitboy85 commented on Jul 31, 2021

    @bitboy85

    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.

  11. hdo commented on Nov 26, 2021

    @hdo

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

  12. ThomasAtBBTF commented on Nov 26, 2021

    @ThomasAtBBTF

    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.

  13. hdo commented on Nov 26, 2021

    @hdo

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions