0

How to move mouse pointer to a specific coordinate?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to move mouse pointer to a specific coordinate?

by hwiguna on Tue Dec 12, 2017 6:43 pm

accel_mouse in Adafruit_Circuit_Playground example and ButtonMouseControl in 09.USB example use mouse.h to create relative movement of the mouse.
How do I create absolute screen movements to emulate a touchscreen?
Thanks!

hwiguna
 
Posts: 28
Joined: Wed Nov 16, 2011 10:33 am

Re: How to move mouse pointer to a specific coordinate?

by danhalbert on Tue Dec 12, 2017 9:44 pm

A mouse is inherently relative. I did a little websearching, and there a small programs or hotkeys for various mouse drivers that can reset the mouse to an absolute position, but it's dependent on host software. If you can find such a program for your host computer, you could use the keyboard controls to send the hotkey combination, and then move from there.

danhalbert
 
Posts: 1086
Joined: Tue Aug 08, 2017 12:37 pm

Re: How to move mouse pointer to a specific coordinate?

by hwiguna on Tue Dec 12, 2017 9:57 pm

Thanks Dan!
Looking at how mouse.cpp, it looks like it should be possible to build a different _hidReportDescriptor to represent a touchscreen instead of a mouse.

But I got quickly lost as to what to set these bytes to. :-(
https://docs.microsoft.com/en-us/window ... zer-device

hwiguna
 
Posts: 28
Joined: Wed Nov 16, 2011 10:33 am

Re: How to move mouse pointer to a specific coordinate?

by danhalbert on Tue Dec 12, 2017 10:41 pm

Yes, it's possible :-), but it takes some work. So the question is, has someone already done that work?

https://github.com/NicoHood/HID has touchscreen support
https://www.codeproject.com/Articles/10 ... lator-with is for Teensy, but could be adapted

etc.. I just did a websearch for "arduino hid library touchscreen".

danhalbert
 
Posts: 1086
Joined: Tue Aug 08, 2017 12:37 pm

Re: How to move mouse pointer to a specific coordinate?

by hwiguna on Tue Dec 12, 2017 11:12 pm

That second link looks promising! Thanks Dan!!!

hwiguna
 
Posts: 28
Joined: Wed Nov 16, 2011 10:33 am

Please be positive and constructive with your questions and comments.