focusBrowser | Multi Theft Auto: Wiki Skip to content

focusBrowser

Client-side
Server-side
Shared

This function will attempt to focus the browser or unfocus all browsers. The browser that is focused will retrieve keyboard input.

OOP Syntax Help! I don't understand this!

Syntax

bool focusBrowser ( [ browser webBrowser = nil ] )
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • webBrowser (default: nil): The web browser to be focused - if this is nil, it will unfocus all browsers.

Returns

  • bool: result

Returns true if the browser was focused or if nil was passed, false if it failed to focus or the browser does not exist.

Code Examples

client

This example creates browser and focus it.

local browser = createBrowser(860, 680, false)
addEventHandler("onClientBrowserCreated", browser,
function ()
focusBrowser(source)
end
)