util.input.unregister
Client
Unregisters a previously registered console command handler
Syntax
local status = util.input.unregister(
name,
exec
)Parameters
| Type | Name | Description |
|---|---|---|
string | name | Command name the handler was registered under |
function | exec | Handler function to remove Must be the same function value passed to util.input.register |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true if the handler was found and removed, false otherwise |
Examples
local function on_debug_toggle(args)
core.engine.print("info", "Debug overlay toggled")
end
util.input.register("debug", on_debug_toggle)
-- Remove when no longer needed
util.input.unregister("debug", on_debug_toggle)local handler
handler = function(args)
core.engine.print("info", "Fired once, then removed")
util.input.unregister("setup", handler)
end
util.input.register("setup", handler)