I have a teensy 3.1 working as a keyboard and I wanted to incorporate a few mouse commands into it, I can get the mouse to move relative but I realy want to click a precise place on the screen. Also if I move the mouse fast in the sample code a delay of 1ms instead of 25 the cursor creeps and when I use the moveto nothing happens. I am running Linux Mint 17 Qiana i686. I Also tried setting Mouse.screenSize(3840, 1080, True); just incase, but that didn't seem to work either, again the mouse moved, but not to an absolute position.
I also tried just moving the mouse too far so it hits the edge (known position) then moving it back to where I want it, but this only moved probably 250 pixels at a time. So I am not sure it this will work. Is there anyone else having this problem? Is there a work around, or is it something stupid that I am doing? Code used is below, but it is basically the example code.
I also tried just moving the mouse too far so it hits the edge (known position) then moving it back to where I want it, but this only moved probably 250 pixels at a time. So I am not sure it this will work. Is there anyone else having this problem? Is there a work around, or is it something stupid that I am doing? Code used is below, but it is basically the example code.
Code:
/* Simple USB Mouse Example
Mouse.move working, Mouse.moveTo ignored
*/
void setup() {
Mouse.screenSize(3840, 1080); // configure screen size
}
void loop() {
int i;
for (i=0; i<40; i++) {
Mouse.move(2, -1);
delay(25);
}
for (i=0; i<40; i++) {
Mouse.move(2, 2);
delay(25);
}
for (i=0; i<40; i++) {
Mouse.move(-4, -1);
delay(25);
}
Mouse.moveTo(25, 100);
delay(5000);
}
Code:
/*Mouse.move only moves about 500 pixels max, Mouse.moveTo ignored
*/
void setup() {
Mouse.screenSize(3840, 1080); // configure screen size
} // no setup needed
void loop() {
int i;
Mouse.move(-10000, -10000);
delay(40);
Mouse.move(100, 100);
delay(40);
Mouse.moveTo(25, 100);
delay(5000);
}