Mouse.begin()

Description

Begins emulating the mouse connected to a computer. begin() must be called before controlling the computer. To end control, use Mouse.end().

Syntax

Mouse.begin()

Parameter Values

  • None

Return Values

  • Nothing

Example Code

#include <Mouse.h> void setup() { pinMode(2, INPUT); } void loop() { //initiate the Mouse library when button is pressed if (digitalRead(2) == HIGH) { Mouse.begin(); } }

See Also

Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.