Page 1 of 1

Need mouse or joystick sending percentage coordinates

Posted: Tue Nov 24, 2015 4:21 pm
by franofcholet
Hi,

In my project, I need to know the screen resolution before sending the coordinates. I have 2 solutions : either I get the screen resolution and send absolute coordinates, or I send directly percentage coordinates.

I cant find in the libraries if I am allow to do it with a mouse or joystick device.

Do you know wether it's possible ?

Thanks for your help !

Re: Need mouse or joystick sending percentage coordinates

Posted: Wed Nov 25, 2015 4:24 am
by ulao
Your basic usb set up will not allow data to the client. You send to host normally. If you want to do stuff like that you will need to use the usbFunctionWrite. This can be done with HID based drivers or by making your own vendor specific. There are lots of usbFunctionWrite examples around the forms.

The examples that come with this driver include a data transfer demo. If you only need to get the resolution on boot that could be handy. Otherwise you will need to create a vendor specific driver and send that data in bulk. Another "hack" way to do it would be with software. You could write a PID based device using force feedback and use something like custom force. Then in the software when you create the custom force effect and sendwhat ever you want.

Just a heads up, this may get tricky. Best of luck.