Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/litebot/modules/mouse.ts

A Deno library for interacting with the mouse 🖱️ keyboard ⌨️ and screen 💻. Provides a simple API for creating kbm events, macros, & working with displays. Leverages FFI & C providing high performance while maintaining a simple TypeScript API
Latest
import * as litebot from "https://deno.land/x/litebot@v0.4.4/modules/mouse.ts";

Variables

Gets the current mouse position in screen space. This will return a object containing both the x and y value of -1 if the operation failed.

Async method for performing clicks acting as the4 user. This method is nonblocking so use await to avoid any race conditions with other mouse/keyboard operations.

Move the mouse down by a relative amount.

Move the mouse left by a relative amount.

Move the mouse right by a relative amount.

Move the mouse up by a relative amount.

Moves the mouse relative to the current position. values are relative to the current mouse position.

Set the mouse location with screen-space x, y cordinates. The function can fail if the caller passes in bounds that do not exists. However this will simply move the mouse to the edge of the screen.

Type Aliases

Default value is leftClick = true, and the x and y positions are determined by the current mouse position. If these are overidden then the mouse click will be at thye new x and y location.