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