contextActionServiceUtil
A simple utility module for working with ContextActionService.
Functions
bindActionNoInputSink
contextActionServiceUtil.bindActionNoInputSink(actionName: string,createTouchButton: boolean,...: Enum.UserInputType | Enum.KeyCode) → ()
Works almost exactly the same as ContextActionService:BindAction,
except that a custom handler is passed as the 2nd argument, which then calls actionCallbackbut returns Enum.ContextActionResult.Pass so
the handler never sinks any inputs.
You can think of the custom handler like this:
function(...)
actionCallback(...)
return Enum.ContextActionResult.Pass
end
contextActionServiceUtil.bindActionNoInputSink(
"Input",
function(_, inputState: Enum.UserInputState, inputObject: InputObject)
print("User pressed Enum.Keycode.A")
end,
false, Enum.Keycode.A
)