Trying to modify the native mouse methods so that it can use absolute, rather than the relative values it currently uses. This is so it can function as a touch screen pointer, and NOT a mouse.
Am using this modified HID.cpp file here
Mostly works, but the author has mapped to the maximum and minimum possible int values, (-32768 to 32767) and no matter what permutation of values I use with the native map method, I can't get it to work properly.
Has anyone wrestled with this problem and has a solution?
Since posting found another possible solution http://forum.arduino.cc/index.php/topic,94140.0.html
However with this solution the mouse movements are WAY too coarse for any monitor with a resolution above 100x100. Tried changing the LOGICAL_MAXIMUM value in HID.cpp but that alone doesn't work. Any C++ gurus possibly able to have a look?
Going back to the first solution this is the map method calls I am using, which should theoretically work!. TAR_WIDTH is the horizontal display resolution of my target monitor. TAR_HEIGHT is the vertical display resolution
xPos2= map(xPos, 0, TAR_WIDTH, -32768, 32767);
yPos2= map(yPos, 0, TAR_HEIGHT, -32768, 32767);
What happens is that when the x value is roughly -2800 or less than, I've reached the left edge of my monitor
Ditto for y, when less than or equal to -2800, I've reached the top.
Moving to the right and or down, once I reach roughly a value of 5000, x, OR y, the mouse wraps back to the left or top edge.
This value of 5000 represents only about 2/3 the width of my target monitor so I'm never able to fully map my mouse movement. Make sense?
So in summary, if I use solution1, I need to figure out how to fully map to my monitor. If solution 2, the movement is too coarse(and the mouseclick doesn't work).