Browser::sendMouseClickEvent
Client-Side Function
JavaScript |
---|
JavaScript Syntax
sendMouseClickEvent
This function simulates mouse click events in a CEF browser. It enables interactions with the in-game browser interface programmatically by sending click coordinates, button type, and associated flags.
Syntax
browser.sendMouseClickEvent(buttonType, x, y, isUp);
Required Arguments
- buttonType: number - The mouse button type:
* 0: Left button * 1: Middle button * 2: Right button
- x: number - X coordinate of the click position.
- y: number - Y coordinate of the click position.
- isUp: boolean - Indicates if the click is a press (`false`) or release (`true`).
Return Value
- Undefined
Example
const browser = mp.browsers.at(1);
// Simulate a left mouse button click at coordinates (200, 300)
browser.sendMouseClickEvent(0, 200, 300, false); // Mouse press
browser.sendMouseClickEvent(0, 200, 300, true); // Mouse release
See Also
- Functions:
- Properies: