Skip to main content

Input

The Input class provides a way to listen for key events such as presses or releases. You can bind custom functions to specific keys, allowing for flexible input handling.

Authority: Client -- All input methods are client-side only.

tip
  • When using a key to set input mode, the key "released" event will automatically trigger.
  • For example, binding a pressed key to open a WebUI will cause its "released" counterpart to trigger when you use SetInputMode(1).

Methods

MethodParametersReturn TypeAuthorityDescription
Input.BindKeyKey: string, Callback: function, ListenerType?: stringvoidClientBinds a function to an event listener type for a specific key. ListenerType defaults to "Pressed". Can also be "Released".

Examples

Binding Key Events

// Input bindings are handled via Lua or JavaScript scripting on the client.

note

Input bindings persist until the client disconnects. If you bind actions in a temporary game mode, remember to manage your bindings appropriately when the mode ends.