Skip to main content
Module

x/litebot/mod.ts>mouseClick

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
variable mouseClick
import { mouseClick } from "https://deno.land/x/litebot@v0.4.4/mod.ts";

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.

Examples

// left click at position 50, 100 setMousePos(50, 100); await mouseClick(); // right click at same position await mouseClick({ leftClick: false }); // You can also add a delay between the clickDown and clickUp events by specifying the delay attribute. await mouseClick ({ delay: 50 }) // Wait 50ms between click down and click up. The default is 10ms. // left click at -100, 100 await mouseClick({ x: -100, y: 100, leftClick: true });

type

(options?: LitebotClickOptions) => Promise<void>