InjectBrowserMouseDown

From Multi Theft Auto: Wiki
Revision as of 23:00, 1 October 2024 by FileEX (talk | contribs) (Add missing argument)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function injects a mouse click (state: down).

Syntax

bool injectBrowserMouseDown ( browser webBrowser, string mouseButton [, bool doubleClick = false ] )

OOP Syntax Help! I don't understand this!

Method: browser:injectMouseDown(...)


Required arguments

  • webBrowser: The web browser
  • mouseButton: The mouse button (Possible values: left, middle, right)

Optional arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • doubleClick: Specifies whether it is a double click or not.

Returns

Returns true if the click was successfully injected, false otherwise.

Example

addEventHandler("onClientClick", root,
    function(button, state)
        if state == "down" then
            injectBrowserMouseDown(browser, button)
        else
            injectBrowserMouseUp(browser, button)
        end 
    end
)

See also