Is that correct? BindAction for MouseMovement doesn't work over buttons?

Before opening a bug report I would like to confirm:

  1. Create a TextButton:
    image

  2. Run this LocalScript:

local ContextActionService = game:GetService("ContextActionService")
local function Input(ActionName, InputState, InputObject)
	print(InputState)
end
ContextActionService:BindAction("Input", Input, false, Enum.UserInputType.MouseMovement)
  1. Move the mouse outside and inside the button.
  2. When the mouse is over the button, the BindAction function will not be executed.

Is that correct? @incapaz

Intended. TextButtons are internally observed by the engine and capture input. ContextActionService doesn’t fire actions where gameProcessedEvent would be true for UserInputService.

The same boilerplate that you may write for UserInputService events not to continue with a function if gameProcessedEvent is true, ContextActionService does it for you under the hood so you don’t have to do it. Hovering over TextButtons is considered an internal binding.

See ContextActionService. As for test code:

local uis = game:GetService("UserInputService")

uis.InputChanged:Connect(function (io, gpe)
	if io.UserInputType == Enum.UserInputType.MouseMovement then
		print(gpe)
	end
end)

Hover on and off a TextButton with this running in a LocalScript in StarterPlayerScripts. It will become true when the TextButton is hovered and false when it isn’t.