gs.MouseInput Class
This class gives access to mouse or touch input. Mouse-buttons or mouse-position is automatically mapped to touch-input on touch-devices like smartphones. For example: A single tap counts as a left mouse-click and a double-tap counts as a right mouse-click.
Constructor
gs.MouseInput
()
final
static
Item Index
Methods
- clear static
- initialize static
- press static
- update static
Properties
- buttonDown static
- buttons static
- buttonUp static
- initialized static
- mouseMoveOnTouchDevices static
- moved static
- touchButtonsEnabled static
- wheel static
- wheelChanged static
- x static
- y static
Methods
clear
()
static
Clears the state of the mouse-buttons.
initialize
()
static
Initializes the mouse/touch system. Needs to be called before any mouse/touch input can be received.
press
-
button
Checks if the specified mouse button is pressed.
Parameters:
-
button
Number- The button to check.
Returns:
If true the button is pressed. Otherwise false
update
()
static
Updates the mouse/touch input-system. Needs to be called once per frame.
Properties
initialized
Boolean
static
Indicates if the mouse-input system is initialized.
mouseMoveOnTouchDevices
Boolean
static
Indicates if mouse-move should be supported for touch-devices.
Default: false
moved
Boolean
static
Indicates if the mouse/touch pointer moved.
touchButtonsEnabled
Boolean
static
Indicates if the invisible virtual touch-buttons are enabled. For more info about virtual buttons, see help-file.
Default: false
wheel
Number
static
The current state of the mouse-wheel. Its the wheel-delta.
wheelChanged
Boolean
static
Indicates if the mouse-wheel state has changed.
x
Number
static
The x-coordinate of the mouse/touch pointer position.
y
Number
static
The y-coordinate of the mouse/touch pointer position.