Hide minor edits - Show changes to markup
(:code lang=arduino tabwidth=4:)
(:source lang=arduino tabwidth=4:)
pinMode(2, INPUT);
pinMode(2,INPUT); //initiate the Mouse library Mouse.begin();
//initiate the Mouse library when button is pressed
//if the button is pressed, send a Right mouse click
Mouse.begin(); }
Mouse.click(); }
(:codeend:)
(:sourceend:)
(:code lang=arduino tabwidth=4:) void setup(){
pinMode(2, INPUT);
}
void loop(){
//initiate the Mouse library when button is pressed
if(digitalRead(2) == HIGH){
Mouse.begin();
}
} (:codeend:)
Mouse.click();
Mouse.click();\\
Mouse.click() defaults to the left mouse button.
Mouse.click();
Sends a momentary click to the computer at the location of the cursor.
Sends a momentary click to the computer at the location of the cursor. This is the same as pressing and immediately releasing the mouse button.
button: which mouse button to press - int
button: which mouse button to press - char
Sends a click to the computer at the location of the cursor.
Sends a momentary click to the computer at the location of the cursor.
Sends a click to the computer at the location of the cursor.
WARNING: When you use the Mouse.click() command, the Arduino takes over your mouse! Make sure you have control before you use the command. A pushbutton to toggle the mouse control state is effective.
Mouse.click(button);
button: which mouse button to press - int
nothing