guiSetInputMode | Multi Theft Auto: Wiki Skip to content

guiSetInputMode

Client-side
Server-side
Shared

Pair: guiGetInputMode

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function controls the input mode to define whether or not (and when) keybinds or MTA binds are overridden (disabled) so that text can be input into an editbox, for example. Available input modes are:

OOP Syntax Help! I don't understand this!

Syntax

bool guiSetInputMode ( string mode )
Required Arguments
  • mode: a string representing the desired input mode. Accepted values are: "allow_binds": binds are enabled, hence using a key such as t in an editbox will still open the chatbox (default) "no_binds": binds are disabled, hence using a key such as t will never open the chatbox "no_binds_when_editing": binds are enabled except when an editbox or memo has input focus

Returns

  • bool: value

Returns true if input mode could be changed, false if invalid parameters are passed.

Code Examples

shared
function onClientResourceStartSetGUIInputMode()
guiSetInputMode("no_binds_when_editing") -- Calls guiSetInputMode once and for all to not have to handle binds state dynamically
end
addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStartSetGUIInputMode)

See Also

GUI Functions