guiSetInputMode | Multi Theft Auto: Wiki Skip to content

guiSetInputMode

Client-side
Server-side
Shared

Pair: guiGetInputMode

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.

Note

This function can be used as a replacement of guiSetInputEnabled since it provides the same functionality with one added feature.

  • guiSetInputEnabled(false) is the same as guiSetInputMode("allow_binds").
  • guiSetInputEnabled(true) is the same as guiSetInputMode("no_binds").

OOP Syntax Help! I don't understand this!

  • Method:GuiElement.setInputMode(...)
  • Variable: .inputMode

Syntax

bool guiSetInputMode ( ​string mode )
Required arguments
  • mode: A string representing the desired input mode.
    • allow_binds: Binds are enabled, hence using a key such as t in an editbox will still activate the chatbox.
    • no_binds: Binds are disabled, hence using a key such as t in an editbox will not activate the chatbox.
    • no_binds_when_editing: Binds are always enabled except when an editable editbox or memo has input focus.

Returns

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

  • bool: result

Code Examples

client
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