Issue Area: DevHub Content
Page URL: ContextActionService | Roblox Creator Documentation
Due to the lack of documentation, confusion was created:
Reproduction Steps
Create a button
Run this on LocalScript:
local ContextActionService = game:GetService("ContextActionService")
local function Click(actionName, inputState, inputObj)
print("actionName, inputState, inputObj: ", actionName, inputState, inputObj.UserInputType)
end
ContextActionService:BindAction("Click", Click, false, Enum.UserInputType.MouseButton1)
Click in and out of the button
Expected Behavior
function Click should be fired on any situation
Actual Behavior
functio…
… because ContextActionService:BindAction
does not intercept mouse clicks over buttons, while UserInputService.InputBegan
does.
It would be important to document this exception.
1 Like
This is documented under GuiObject:
ContextActionService notes that when input is sunk, it won’t be passed to other handlers. Though explicitly documenting it under ContextActionService probably wouldn’t hurt, however it is documented.
2 Likes