Input

The user's input can be accessed in three ways: 
*through a which is passed by the events InputBegan, InputChanged and InputEnded of either the service or a UI element ()
*binding a UserInputType through the service
*through the object which can be accessed either by the GetMouse function of a , the GetMouse function of a Plugin, or the Equipped event of a (this is considered the legacy way of accessing the mouse and keyboard input, and is considered superseded by the others as it does not account for other inputs such as the touch input)
== History ==
The and services were introduced sometime in 2014. Previously, the 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:
*Mouse inputs:
**MouseButton1 (defaulted to left-click)
**MouseButton2 (defaulted to right-click)
**MouseButton3 (defaulted to middle-click)
**MouseWheel (refers to scrolling)
**MouseMovement
*Touch (refers to touchscreen input)
*Keyboard
*Focus (refers to the client regaining focus of the Roblox window)
*Mobile inputs:
**Accelerometer (represents the device's acceleration in the real world)
**Gyro (represents the device's orientation and angular velocity in the real world)
*Gamepad1 to Gamepad8 (represents each USB gamepad that is connected)
*TextInput (refers to input of Text into a )
*InputMethod (refers to Text input from an input method editor)
*None
=== InputObject ===
User inputs are represented as s. InputObjects are passed by the events InputBegan, InputChanged and InputEnded of either the service or a UI element (). InputObjects have the UserInputType property.
=== Binding ===
UserInputTypes can be binded through the service.
== Mouse class ==
The is a class that represents the user's mouse (although it has keyboard input events KeyUp and KeyDown) and has two sub-classes: and .
The object is passed by the Equipped event of a . The is accessed through the GetMouse function of a . This function can only be called from the client. The is accessed through the GetMouse function of the Plugin object.
== External links ==
* Input and Camera on Roblox Creator Documentation
Category:Game development