new State(templateopt)
The current state of a mouse, including position and buttons.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
template |
Guacamole.Mouse.State | object |
<optional> |
{} | The object whose properties should be copied within the new Guacamole.Mouse.State. |
- Source:
Extends
Members
(static, readonly) Buttons
All mouse buttons that may be represented by a
Guacamole.Mouse.State.
Properties:
Name | Type | Description |
---|---|---|
LEFT |
string | The name of the Guacamole.Mouse.State property representing the left mouse button. |
MIDDLE |
string | The name of the Guacamole.Mouse.State property representing the middle mouse button. |
RIGHT |
string | The name of the Guacamole.Mouse.State property representing the right mouse button. |
UP |
string | The name of the Guacamole.Mouse.State property representing the up mouse button (the fourth mouse button, clicked when the mouse scroll wheel is scrolled up). |
DOWN |
string | The name of the Guacamole.Mouse.State property representing the down mouse button (the fifth mouse button, clicked when the mouse scroll wheel is scrolled up). |
- Source:
(non-null) down :boolean
Whether the down mouse button is currently pressed. This is the fifth
mouse button, associated with downward scrolling of the mouse scroll
wheel.
Type:
- boolean
- Default Value:
- false
- Source:
(non-null) left :boolean
Whether the left mouse button is currently pressed.
Type:
- boolean
- Default Value:
- false
- Source:
(non-null) middle :boolean
Whether the middle mouse button is currently pressed.
Type:
- boolean
- Default Value:
- false
- Source:
(non-null) right :boolean
Whether the right mouse button is currently pressed.
Type:
- boolean
- Default Value:
- false
- Source:
(non-null) up :boolean
Whether the up mouse button is currently pressed. This is the fourth
mouse button, associated with upward scrolling of the mouse scroll
wheel.
Type:
- boolean
- Default Value:
- false
- Source:
(non-null) x :number
The current X position, in pixels.
Type:
- number
- Inherited From:
- Default Value:
- 0
- Source:
(non-null) y :number
The current Y position, in pixels.
Type:
- number
- Inherited From:
- Default Value:
- 0
- Source:
Methods
fromClientPosition(elementnon-null, clientXnon-null, clientYnon-null)
Assigns the position represented by the given element and
clientX/clientY coordinates. The clientX and clientY coordinates are
relative to the browser viewport and are commonly available within
JavaScript event objects. The final position is translated to
coordinates that are relative the given element.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element | The element the coordinates should be relative to. |
clientX |
number | The viewport-relative X coordinate to translate. |
clientY |
number | The viewport-relative Y coordinate to translate. |
- Inherited From:
- Source: