Detecting MouseButton1Up on a focused Plugin Widget

Within my plugin widget I have a slider. I can only detect user interaction with the button when the mouse is inside it.

My main problem is when the user focuses on the button to move it, the user’s mouse may exit the bounds of the button, then they lift their finger off the left mouse button, but the slider button is still moving around because it couldn’t tell the user released focus.

I’ve tried using UserInputService.InputEnded and plugin:GetMouse(). They only seem to fire when the player is focused on the Viewport. I’ve seen post like this

asking the same exact question but getting little to no answers so I’m not sure if it’s possible but I believe it is because Roblox’s built-in UIGradient editor stops moving the Keypoints when the user lifts their finger from the left mouse button when the mouse is not longer in the bounds of the triangle.

1 Like

I know, I know. This is 2 years ago but I have a solution for this.

Which is… make a frame the size of your gui in the widget and set it’s Z-Index to “999999999”. Basically, it should be on-top of everything in your gui. Then you need to use

Frame.InputEnded

To just see if left mouse button has been released!

Example:

Base.MainOverlay.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		StopEditing()
	end
end)

(From my plugin)

Hope this helped after 2 years!!! >w<

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.