Mouse

extends Instance

Class fields

FieldXML typeValue
NamestringMouse
summarystringUsed to receive input from the user. Actually tracks mouse events and keyboard events.

Properties

13
Hit
CoordinateFrame
FieldXML typeValue
NamestringHit
summarystringThe CoordinateFrame of where the Mouse ray is currently hitting a 3D object in the Workspace. If the mouse is not over any 3D objects in the Workspace, this property is nil.
Icon
Content
FieldXML typeValue
NamestringIcon
summarystringThe current Texture of the Mouse Icon. Stored as a string, for more information on how to format the string <a href="http://wiki.roblox.com/index.php/Content" target="_blank">go here</a>
Origin
CoordinateFrame
FieldXML typeValue
NamestringOrigin
summarystringThe CoordinateFrame of where the Mouse is when the mouse is not clicking.
Target
Object
FieldXML typeValue
NamestringTarget
summarystringThe Part the mouse is currently over. If the mouse is not currently over any object (on the skybox, for example) this property is nil.
TargetFilter
Object
FieldXML typeValue
NamestringTargetFilter
summarystringA Part or Model that the Mouse will ignore when trying to find the Target, TargetSurface and Hit.
TargetSurface
NormalId
FieldXML typeValue
NamestringTargetSurface
summarystringThe NormalId (Top, Left, Down, etc.) of the face of the part the Mouse is currently over.
UnitRay
Ray
FieldXML typeValue
NamestringUnitRay
summarystringThe Unit Ray from where the mouse is (Origin) to the current Mouse.Target.
ViewSizeX
int
FieldXML typeValue
NamestringViewSizeX
summarystringThe viewport's (game window) width in pixels.
ViewSizeY
int
FieldXML typeValue
NamestringViewSizeY
summarystringThe viewport's (game window) height in pixels.
X
int
FieldXML typeValue
NamestringX
summarystringThe absolute pixel position of the Mouse along the x-axis of the viewport (game window). Values start at 0 on the left hand side of the screen and increase to the right.
Y
int
FieldXML typeValue
NamestringY
summarystringThe absolute pixel position of the Mouse along the y-axis of the viewport (game window). Values start at 0 on the stop of the screen and increase to the bottom.
hit
CoordinateFrame
FieldXML typeValue
Namestringhit
target
Object
FieldXML typeValue
Namestringtarget

Events

11
Button1Down
() → void
FieldXML typeValue
NamestringButton1Down
summarystringFired when the first button (usually the left, but could be another) on the mouse is depressed.
Button1Up
() → void
FieldXML typeValue
NamestringButton1Up
summarystringFired when the first button (usually the left, but could be another) on the mouse is release.
Button2Down
() → void
FieldXML typeValue
NamestringButton2Down
summarystringThis event is currently non-operational.
Button2Up
() → void
FieldXML typeValue
NamestringButton2Up
summarystringThis event is currently non-operational.
Idle
() → void
FieldXML typeValue
NamestringIdle
summarystringFired constantly when the mouse is not firing any other event (i.e. the mouse isn't moving, nor any buttons being pressed or depressed).
KeyDown
(key: string) → void
FieldXML typeValue
NamestringKeyDown
summarystringFired when a user presses a key on the keyboard. Argument is a string representation of the key. If the key has no string representation (such as space), the string passed in is the keycode for that character. Keycodes are currently in ASCII.
KeyUp
(key: string) → void
FieldXML typeValue
NamestringKeyUp
summarystringFired when a user releases a key on the keyboard. Argument is a string representation of the key. If the key has no string representation (such as space), the string passed in is the keycode for that character. Keycodes are currently in ASCII.
Move
() → void
FieldXML typeValue
NamestringMove
summarystringFired when the mouse X or Y member changes.
WheelBackward
() → void
FieldXML typeValue
NamestringWheelBackward
summarystringThis event is currently non-operational.
WheelForward
() → void
FieldXML typeValue
NamestringWheelForward
summarystringThis event is currently non-operational.
keyDown
(key: string) → void
FieldXML typeValue
NamestringkeyDown