Skip to main content

Mouse

Basic USB mouse support.

Methods

init

Initialize mouse routines.

Mouse.init();

get

Returns mouse actual properties on the object format below:

const mouse = Mouse.get();

Properties

  • mouse.x
  • mouse.y
  • mouse.wheel
  • mouse.buttons

setBoundary

Set mouse x and y bounds.

Mouse.setBoundary(minX, maxX, minY, maxY);

getMode

Get mouse mode (absolute or relative).

const mode = Mouse.getMode();

setMode

Set mouse mode.

Mouse.setMode(mode);

getAccel

Get mouse acceleration.

const acceleration = Mouse.getAccel();

setAccel

Set mouse acceleration.

Mouse.setAccel(val);

setPosition

Set mouse pointer position.

Mouse.setPosition(x, y);