ZeroController
This function was added in DSL 6
Description
Zero all the input memory on a controller.
This is a good way to disable all input on an input device, but remember to call it on both controller-related events. If you do not call it during both events, buttons may misbehave and act like they're being repeatedly pressed.
function ZeroController(controller) --[[ ... ]] end
Parameters
controller
:0|1|2|3
- The controller to zero.
Return Values
None.
Versions
- DSL5 - This function was released as
DisableController
but did not work properly. - DSL6 - This function now works as intended and was re-named.
Example
Disable the player's controls fully.
RegisterLocalEventHandler('ControllerUpdating', function(controller)
if controller == 0 then
ZeroController(controller)
end
end)
RegisterLocalEventHandler('ControllersUpdated', function()
ZeroController(0)
end)