FabGL
ESP32 Display Controller and Graphics Library

◆ getNextStatus()

MouseStatus getNextStatus ( int  timeOutMS = -1)

Gets the next status from the status queue.

Mouse status contains absolute mouse position, scroll wheel delta and buttons status.
Mouse status queue is populated only when createAbsolutePositionsQueue parameter of Mouse.setupAbsolutePositioner() is true.

Parameters
timeOutMSTimeout in milliseconds to wait for a new status. -1 = wait forever.
Returns
The next status in queue.

Example:

// wait for events from mouse and draw a pixel at the mouse position if left button is down
MouseStatus status = Mouse.getNextStatus();
if (status.buttons.left) {
  Canvas.setPenColor(Color::BrightRed);
  Canvas.setPixel(status.X, status.Y);
}
Examples:
VGA/MouseOnScreen/MouseOnScreen.ino.

Definition at line 318 of file mouse.cpp.