roblox

The user's input can be accessed in three ways:

History

The Light service iconDark service iconUserInputService and Light service iconDark service iconContextActionService services were introduced sometime in 2014. Previously, the Mouse class was the primary way of accessing mouse and keyboard input.

At some point, the KeyUp and KeyDown events of the Mouse class were deprecated in favor of the new services.

UserInputType

The UserInputType enum represents a type of user input. There are 21 UserInputTypes:

InputObject

User inputs are represented as InputObjects. InputObjects are passed by the events InputBegan, InputChanged and InputEnded of either the Light service iconDark service iconUserInputService service or a UI element (GuiObject). InputObjects have the UserInputType property.

Binding

UserInputTypes can be binded through the Light service iconDark service iconContextActionService service.

Mouse class

The Mouse is a class that represents the user's mouse (although it has keyboard input events KeyUp and KeyDown) and has two sub-classes: PlayerMouse and Light blank iconDark blank iconPluginMouse.

The Mouse object is passed by the Equipped event of a Tool light iconTool dark iconTool. The PlayerMouse is accessed through the GetMouse function of a Player light iconPlayer dark iconPlayer. This function can only be called from the client. The Light blank iconDark blank iconPluginMouse is accessed through the GetMouse function of the Plugin object.

External links