diff --git a/modules/input/Mouse.lua b/modules/input/Mouse.lua index c37be961..43beb5c9 100644 --- a/modules/input/Mouse.lua +++ b/modules/input/Mouse.lua @@ -42,6 +42,16 @@ Mouse.__index = Mouse @prop RightUp Signal @tag Event ]=] +--[=[ + @within Mouse + @prop MiddleDown Signal + @tag Event +]=] +--[=[ + @within Mouse + @prop MiddleUp Signal + @tag Event +]=] --[=[ @within Mouse @prop Moved Signal @@ -77,6 +87,8 @@ function Mouse.new() self.LeftUp = self._trove:Construct(Signal) self.RightDown = self._trove:Construct(Signal) self.RightUp = self._trove:Construct(Signal) + self.MiddleDown = self._trove:Construct(Signal) + self.MiddleUp = self._trove:Construct(Signal) self.Scrolled = self._trove:Construct(Signal) self.Moved = self._trove:Construct(Signal) @@ -88,6 +100,8 @@ function Mouse.new() 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) @@ -99,6 +113,8 @@ function Mouse.new() 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) @@ -131,6 +147,13 @@ function Mouse:IsRightDown(): boolean return UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) end +--[=[ + Checks if the middle mouse button is down. +]=] +function Mouse:IsMiddleDown(): boolean + return UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton3) +end + --[=[ Gets the screen position of the mouse. ]=]