Mouse.click Reference Correction

The example code for the Mouse.click() reference needs to be corrected: Mouse.click() - Arduino Reference

The comment in the void loop states if the button is pressed it sends a Right mouse click but that's not the case. It actually sends the (default) click which is the Left mouse click. To fix it you could change the comment from Right to Left or add MOUSE_RIGHT inside the Mouse.click(); parentheses to achieve the Right mouse click function. Updated code below:

In this code I just changed the comment to "send a Left mouse click" instead of "send a Right mouse click":

void setup(){
  pinMode(2,INPUT);
  //initiate the Mouse library
  Mouse.begin();
}

void loop(){
  //if the button is pressed, send a Left (default) mouse click
  if(digitalRead(2) == HIGH){
    Mouse.click();
  } 
}

In this code I added MOUSE_RIGHT inside of Mouse.click();

void setup(){
  pinMode(2,INPUT);
  //initiate the Mouse library
  Mouse.begin();
}

void loop(){
  //if the button is pressed, send a Right mouse click
  if(digitalRead(2) == HIGH){
    Mouse.click(MOUSE_RIGHT);
  } 
}

Either of these codes fixes the issue :wink: