Skip to main content

InputTypeUtils

Types

InputType

type InputType = KeyCode | UserInputType | SlottedTouchButton | "TouchButton" | "Tap" | "Drag" | any

A valid input type that can be represented here.

SlottedTouchButton

interface SlottedTouchButton {
type"SlottedTouchButton"
slotIdstring
}

A touch button that goes into a specific slot. This ensures consistent slot positions.

Functions

isKnownInputType

InputTypeUtils.isKnownInputType(inputTypeany) → boolean

Returns true if the input type is a known input type

isTapInWorld

InputTypeUtils.isTapInWorld(inputKeyany) → boolean

Returns true if the input type is specifying a tap in the world

isDrag

InputTypeUtils.isDrag(inputKeyany) → boolean

Returns true if the input type is specifying a drag

isRobloxTouchButton

InputTypeUtils.isRobloxTouchButton(inputKeyany) → boolean

Returns true if the input type is specifying a Roblox touch button

createTapInWorld

InputTypeUtils.createTapInWorld() → "Tap"

Specifies a tap in the world

createRobloxTouchButton

InputTypeUtils.createRobloxTouchButton() → "Tap"

Specifies a roblox touch button

getUniqueKeyForInputType

InputTypeUtils.getUniqueKeyForInputType(inputTypeInputType) → any

Computes a unique id for an inputType which can be used in a set to deduplicate/compare the objects. Used to know when to exclude different types from each other.

areInputTypesListsEquivalent

InputTypeUtils.areInputTypesListsEquivalent(
a{InputType},
b{InputType}
) → boolean

Expensive comparison check to see if InputTypes are the same or not.

Show raw api
{
    "functions": [
        {
            "name": "isKnownInputType",
            "desc": "Returns true if the input type is a known input type",
            "params": [
                {
                    "name": "inputType",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 41,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "isTapInWorld",
            "desc": "Returns true if the input type is specifying a tap in the world",
            "params": [
                {
                    "name": "inputKey",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 57,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "isDrag",
            "desc": "Returns true if the input type is specifying a drag",
            "params": [
                {
                    "name": "inputKey",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 66,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "isRobloxTouchButton",
            "desc": "Returns true if the input type is specifying a Roblox touch button",
            "params": [
                {
                    "name": "inputKey",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 75,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "createTapInWorld",
            "desc": "Specifies a tap in the world",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "\"Tap\""
                }
            ],
            "function_type": "static",
            "source": {
                "line": 83,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "createRobloxTouchButton",
            "desc": "Specifies a roblox touch button",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "\"Tap\""
                }
            ],
            "function_type": "static",
            "source": {
                "line": 91,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "getUniqueKeyForInputType",
            "desc": "Computes a unique id for an inputType which can be used\nin a set to deduplicate/compare the objects. Used to know\nwhen to exclude different types from each other.",
            "params": [
                {
                    "name": "inputType",
                    "desc": "",
                    "lua_type": "InputType"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 103,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "areInputTypesListsEquivalent",
            "desc": "Expensive comparison check to see if InputTypes are the same or not.",
            "params": [
                {
                    "name": "a",
                    "desc": "",
                    "lua_type": "{ InputType }"
                },
                {
                    "name": "b",
                    "desc": "",
                    "lua_type": "{ InputType }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 130,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "InputType",
            "desc": "A valid input type that can be represented here.",
            "lua_type": "KeyCode | UserInputType | SlottedTouchButton | \"TouchButton\" | \"Tap\" | \"Drag\" | any",
            "source": {
                "line": 20,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        },
        {
            "name": "SlottedTouchButton",
            "desc": "A touch button that goes into a specific slot. This ensures\nconsistent slot positions.",
            "fields": [
                {
                    "name": "type",
                    "lua_type": "\"SlottedTouchButton\"",
                    "desc": ""
                },
                {
                    "name": "slotId",
                    "lua_type": "string",
                    "desc": ""
                }
            ],
            "source": {
                "line": 31,
                "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
            }
        }
    ],
    "name": "InputTypeUtils",
    "desc": "",
    "source": {
        "line": 5,
        "path": "src/inputkeymaputils/src/Shared/Types/InputTypeUtils.lua"
    }
}