Skip to main content

InputMode

Trace input mode state and trigger changes correctly. See [InputModeSelector] for details on how to select between these. See [InputModeTypeTypes] for predefined modes.

Properties

Enabled

InputMode.Enabled: Signal<()>

Fires off when the mode is enabled

Name

InputMode.Name: Signal<()>

Name of the InputMode

Functions

new

InputMode.new(inputModeTypeInputModeType) → InputMode

Constructs a new InputMode. This inherits data from the name.

isInputMode

InputMode.isInputMode(valueany) → boolean

Returns true if a given value is an InputMode

GetLastEnabledTime

InputMode:GetLastEnabledTime() → number

Checks the last point this input mode was used.

GetKeys

InputMode:GetKeys() → {UserInputType | KeyCode | string}

Returns all keys defining the input mode.

IsValid

InputMode:IsValid(inputType{UserInputType | KeyCode | string}) → boolean

Checks the validity of the inputType

Enable

InputMode:Enable() → ()

Enables the mode

Evaluate

InputMode:Evaluate(inputObjectInputObject) → ()

Evaluates the input object, and if it's valid, enables the mode

Destroy

InputMode:Destroy() → ()

Cleans up the input mode

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new InputMode. This inherits data from the name.",
            "params": [
                {
                    "name": "inputModeType",
                    "desc": "",
                    "lua_type": "InputModeType"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "InputMode"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 35,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "isInputMode",
            "desc": "Returns true if a given value is an InputMode",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 53,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "GetLastEnabledTime",
            "desc": "Checks the last point this input mode was used.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 61,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "GetKeys",
            "desc": "Returns all keys defining the input mode.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ UserInputType | KeyCode | string }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 69,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "IsValid",
            "desc": "Checks the validity of the inputType",
            "params": [
                {
                    "name": "inputType",
                    "desc": "",
                    "lua_type": "{ UserInputType | KeyCode | string }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 78,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "Enable",
            "desc": "Enables the mode",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 87,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "Evaluate",
            "desc": "Evaluates the input object, and if it's valid, enables the mode",
            "params": [
                {
                    "name": "inputObject",
                    "desc": "",
                    "lua_type": "InputObject"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 96,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the input mode",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 107,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Enabled",
            "desc": "Fires off when the mode is enabled",
            "lua_type": "Signal<()>",
            "source": {
                "line": 18,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        },
        {
            "name": "Name",
            "desc": "Name of the InputMode",
            "lua_type": "Signal<()>",
            "source": {
                "line": 24,
                "path": "src/inputmode/src/Client/InputMode.lua"
            }
        }
    ],
    "types": [],
    "name": "InputMode",
    "desc": "Trace input mode state and trigger changes correctly. See [InputModeSelector] for details\non how to select between these. See [InputModeTypeTypes] for predefined modes.",
    "source": {
        "line": 7,
        "path": "src/inputmode/src/Client/InputMode.lua"
    }
}