Skip to content

MouseInput

Inherited from BaseObject

{client-only}

This is the replacement for Roblox's deprecated Mouse class.

Enable

{internal}

Re-connects internal connections to handle events.

mouseInput:Enable()

Disable

{internal}

Disconnects internal connections to handle events.

mouseInput:Disable()

Events

All event callbacks have an InputObject as their first and only argument.

Move

Fires when the mouse moves.

mouseInput.Move:Connect(function(inputObject)
    print("Move")
end)

Button1Down

Fires when the left-mouse button is depressed.

mouseInput.Button1Down:Connect(function(inputObject)
    print("Button1Down")
end)

Button1Up

Fires when the left-mouse button is raised.

mouseInput.Button1Up:Connect(function(inputObject)
    print("Button1Up")
end)

Button2Down

Fires when the right-mouse button is depressed.

mouseInput.Button2Down:Connect(function(inputObject)
    print("Button2Down")
end)

Button2Up

Fires when the right-mouse button is raised.

mouseInput.Button2Up:Connect(function(inputObject)
    print("Button2Up")
end)

Button3Down

Fires when the middle-mouse button (scroll-wheel) is depressed.

mouseInput.Button3Down:Connect(function(inputObject)
    print("Button3Down")
end)

Button3Up

Fires when the middle-mouse button (scroll-wheel) is raised.

mouseInput.Button3Up:Connect(function(inputObject)
    print("Button3Up")
end)

WheelBackward

Fires when the scroll-wheel rolls backwards.

mouseInput.WheelBackward:Connect(function(inputObject)
    print("WheelBackward")
end)

WheelForward

Fires when the scroll-wheel rolls forward.

mouseInput.WheelForward:Connect(function(inputObject)
    print("WheelForward")
end)