Mouse - Mouse.end()

Stops emulating the mouse connected to a computer. To start control, use Mouse.begin().

Syntax

Mouse.end()

Parameters

None.

Returns

None.

Example

#include <Mouse.h>

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

void loop() {
  // If the button is pressed, send a left mouse click
  if (digitalRead(2) == HIGH) {
    Mouse.click();
    // Then end the Mouse emulation
    Mouse.end();
  }
}

See also