PDA

View Full Version : USB Mouse Absolute Coordinates



tkamsker
01-27-2013, 02:52 PM
Hi,
i got stuck maybe some hint may help ,.. ;)
I was following the Steps in http://arduino.cc/forum/index.php?topic=94140.0;wap2 for getting the Mouse to work not relative any more ,..
So i then found there is an Teensy folder found the right structure where it is done by Teensy but ,..
it is not working so
my question to you did anyone achieve that so far ?
How do you debug that in c ?

I then have to get my old long time not used (last time it was for OS/2 ;)- C knowledge to do it so if i am locky someone did it the search here sayed no
if i am unlucky i have to fix it but then i need some hints how to debug it to save time then i would do that ,..
so any hint welcome
thx
thomas
Ps: So far i tried to stay away from hid ;)-

PaulStoffregen
09-18-2013, 05:59 PM
I've implemented a new USB mouse type for Teensy3 using absolute positioning. I'm planning to publish this in Teensyduino 1.17.

It adds these functions:



Mouse.moveTo(x, y);
Mouse.screenSize(width, height);
Mouse.screenSize(width, height, isMacintosh); // isMacintosh = true/false to specify if special Mac handling should be used.


The screenSize() lets you specify the intended screen size. The moveTo() function should always take you to the exact coordinates, if you've set the correct screen size. The existing Mouse.move() function should now also move by an exact number of pixel, unaffected by settings like mouse acceleration.

If anyone is following this thread, please give this a try and let me know how it works for you?

Internally, the code plays some scaling tricks to (hopefully) achieve perfect mapping from abstract HID logical units to physical screen pixels. I tested on Ubuntu 12 at 2560x1600, Mac OS-X 10.7.5 at 1920x1200 and Windows 7 64 bit at 1920x1200. If you test on other combinations of operating systems and screen sizes, the main thing to look for is ANY case where moveTo(x, y) is off by even 1 pixel. It is supposed to always give exact pixel positioning.

To use this, copy the 3 files from the zip file into hardware/teensy/cores/teensy3. On a Mac, control-click Arduino, use "show package contents" and navigate a few folders until you find "hardware".

rfresh737
10-06-2015, 03:55 AM
I realize this is an old thread, but will your usb_mouse_absolute file work with the Leonardo board vs the Teensy3 board?

Thanks...