espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.52k stars 7.39k forks source link

USBHIDMouse.h with Absolute Mouse positioning #8133

Closed gree303 closed 1 year ago

gree303 commented 1 year ago

Related area

ESP32

Hardware specification

ESP32-S2 / Nano 33 IOT

Is your feature request related to a problem?

I'm trying to get an absolute mouse working but I'm stuck. The USBHIDMouse does work great with relative mouse movements. Is there any way of inserting this feature, technically speaking? Can you tell me where I'd find the descriptor for it; this way I could fiddle my way through.

Describe the solution you'd like

Maybe you know a workaround or another Library which might work.

I've tried different attempts with different solutions; MouseTo.h, AbsMouse, HID-Project...

I do have a working CuircutPython with random absolute mouse movements running from @dglaude It would be a real bummer switching to python this late in my project.

Any tipp or suggestion will help me... Ty

Describe alternatives you've considered

MouseTo / based on Mouse.h AbsMouse AbsoluteMouse5 HID-Project TFT Touchscreen Simulation ... all kind of forum suggestions and chatGPT testing failed or resulted in a relative mouse. All tested on multiple os's (Win/Mac/Linux) Most of the stuff is 5-10 years old and kinda outdated ;/

Additional context

I don't mind buying you guys'n'girls a couple of beers or so Thanks

I have checked existing list of Feature requests and the Contribution Guide

gree303 commented 1 year ago

PS: I thought about the Teensy 3.1 solution by Elmue @ Teensy 3.1

But at this point I'm kinda lost in all the research; looking forward to your input,ty.

SuGlider commented 1 year ago

@gree303 - Something like this?

    AbsoluteMouse.begin();
    AbsoluteMouse.click(50, 50);    //Middle of screen
gree303 commented 1 year ago

I have not tested your code; but yes.

SuGlider commented 1 year ago

There is a HID BLE implementation for Absolute Mouse in https://github.com/sobrinho/ESP32-BLE-Abs-Mouse

It may help your project.

SuGlider commented 1 year ago

This other Arduino project may also help: https://github.com/jonathanedgecombe/absmouse

It is an USB HID report implementation for absolute mouse.

I think that these 2 links are good pointers to implement your project.

gree303 commented 1 year ago

Thanks @SuGlider I will have a look.

wukongxuetang commented 11 months ago

just this is a sample for absolute mouse https://github.com/earlephilhower/arduino-pico/blob/master/cores/rp2040/sdkoverride/tusb_absmouse.h

wukongxuetang commented 11 months ago

and this one https://github.com/hathach/tinyusb/pull/1363/files/8c79b8924eabf441f40a8ce3cab8828688575b6d esp32 tools have used tinyusb code.

wukongxuetang commented 11 months ago

@gree303 If you have already implemented the solution, would you like to share it?