FabGL
ESP32 Display Controller and Graphics Library

◆ updateAbsolutePosition()

void updateAbsolutePosition ( MouseDelta delta)

Updates absolute position from the specified mouse delta event.

This method updates absolute mouse position, mouse wheel and buttons status.
In order to improve quality of acceleration it is important to call updateAbsolutePosition() often and at constant frequency.
updateAbsolutePosition() is automatically executed when updateDisplayController or createAbsolutePositionsQueue parameters of Mouse.setupAbsolutePositioner() is set.

Parameters
deltaMouse event to process.

Example:

// move a sprite (previously defined) at mouse absolute position
void loop() {
  MouseDelta delta;
  if (getNextDelta(&delta)) {
    Mouse.updateAbsolutePosition(&delta);
    mouseSprite.moveTo(Mouse.position().X, Mouse.position().Y);
  }
}

Definition at line 212 of file mouse.cpp.