InjectBrowserMouseDown: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 19: Line 19:


==Example==
==Example==
<syntaxhighlight lang="lua">addEventHandler("onClientClick", root,
<syntaxhighlight lang="lua">
function(button, state)
addEventHandler("onClientClick", root,
if state == "down" then
    function(button, state)
injectBrowserMouseDown(browser, button)
        if state == "down" then
else
            injectBrowserMouseDown(browser, button)
injectBrowserMouseUp(browser, button)
        else
end  
            injectBrowserMouseUp(browser, button)
end)
        end  
    end
)
</syntaxhighlight>
</syntaxhighlight>


Line 33: Line 35:


[[hu:injectBrowserMouseDown]]
[[hu:injectBrowserMouseDown]]
[[RO:injectBrowserMouseDown]]

Latest revision as of 08:34, 20 April 2020

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

Syntax

bool injectBrowserMouseDown ( browser webBrowser, string mouseButton )

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)

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