Go Down

Topic: Help w/ Mouse.click(); when using absolute mode (Read 1 time) previous topic - next topic

ChuckJaxFL

I'm starting a new thread, as the other thread seems to have died out.

I followed the steps here:  http://arduino.cc/forum/index.php/topic,94140.0.html

I am able to get the mouse cursor to move to a specific location on the screen, as expected.  I am unable to get the Mouse.click() command to click, though.  Has anyone else used this modified HID.cpp file successfully?

pYro_65

Post your code or something that shows what you have attempted. Try using the click and also the press and release options. These options do the same thing, so you could be sending the wrong mouse button ID.

The modifications would only affect what Arduino files are included ( WProgram.h changed to Arduino.h ), not the actual operation of the class.

This will though:

Code: [Select]
void Mouse_::click(uint8_t b)
{
_buttons = b;
// move(0,0,0);
_buttons = 0;
// move(0,0,0);
}


The move sends the x,y, and current button, so that function effectively does nothing but set _buttons to '0'
Try replacing the x,y params of move to the last known position ( or where you want the click ).

Go Up