-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Mouse Down and Up events firing even if the UIS processed parameter is true #216
Comments
I will work on this! |
In the mouse class, you can add the IgnoreProcessedInput setting in the Mouse.luau file in the input folder so that you can set it to true or false whenever you want so that it is customizable for your case. Like the name suggests, it will let you make it so that the mouse button can fire and ignore the processed setting. self.IgnoreProcessedInput = false
self._trove:Connect(UserInputService.InputBegan, function(input, processed)
if processed and not self.IgnoreProcessedInput then
return
end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
self.LeftDown:Fire()
elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
self.RightDown:Fire()
elseif input.UserInputType == Enum.UserInputType.MouseButton3 then
self.MiddleDown:Fire()
end
end)
self._trove:Connect(UserInputService.InputEnded, function(input, processed)
if processed and not self.IgnoreProcessedInput then
return
end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
self.LeftUp:Fire()
elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
self.RightUp:Fire()
elseif input.UserInputType == Enum.UserInputType.MouseButton3 then
self.MiddleUp:Fire()
end
end)
self._trove:Connect(UserInputService.InputChanged, function(input, processed)
if processed and not self.IgnoreProcessedInput then
return
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
local position = input.Position
self.Moved:Fire(Vector2.new(position.X, position.Y))
elseif input.UserInputType == Enum.UserInputType.MouseWheel then
self.Scrolled:Fire(input.Position.Z)
end
end)
return self
|
@hcru77 It is important for the end-user code to have the |
At the moment, the mouse up and down events do not fire if the
UserInputService
processed parameter is trueMy usecase, I am making a custom camera that players can rotate by holding down the right mouse button. If they release the mouse while hovering over a proximity prompt UI, the mouse up event does not fire since processed is true. For this mouse object, I want the events to fire even if processed is true
Perhaps we can add some configuration settings in the mouse constructor to set this as a setting
The text was updated successfully, but these errors were encountered: