Class Guacamole.Mouse.State
Defined in: Mouse.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Guacamole.Mouse.State(x, y, left, middle, right, up, down)
Simple container for properties describing the state of a mouse.
|
Field Attributes | Field Name and Description |
---|---|
Whether the down mouse button is currently pressed.
|
|
Whether the left mouse button is currently pressed.
|
|
Whether the middle mouse button is currently pressed.
|
|
Whether the right mouse button is currently pressed.
|
|
Whether the up mouse button is currently pressed.
|
|
The current X position of the mouse pointer.
|
|
The current Y position of the mouse pointer.
|
Method Attributes | Method Name and Description |
---|---|
fromClientPosition(element, clientX, clientY)
Updates the position represented within this state object by the given
element and clientX/clientY coordinates (commonly available within event
objects).
|
Class Detail
Guacamole.Mouse.State(x, y, left, middle, right, up, down)
Simple container for properties describing the state of a mouse.
- Parameters:
- {Number} x
- The X position of the mouse pointer in pixels.
- {Number} y
- The Y position of the mouse pointer in pixels.
- {Boolean} left
- Whether the left mouse button is pressed.
- {Boolean} middle
- Whether the middle mouse button is pressed.
- {Boolean} right
- Whether the right mouse button is pressed.
- {Boolean} up
- Whether the up mouse button is pressed (the fourth button, usually part of a scroll wheel).
- {Boolean} down
- Whether the down mouse button is pressed (the fifth button, usually part of a scroll wheel).
Field Detail
{Boolean}
down
Whether the down mouse button is currently pressed. This is the fifth
mouse button, associated with downward scrolling of the mouse scroll
wheel.
{Boolean}
left
Whether the left mouse button is currently pressed.
{Boolean}
middle
Whether the middle mouse button is currently pressed.
{Boolean}
right
Whether the right mouse button is currently pressed.
{Boolean}
up
Whether the up mouse button is currently pressed. This is the fourth
mouse button, associated with upward scrolling of the mouse scroll
wheel.
{Number}
x
The current X position of the mouse pointer.
{Number}
y
The current Y position of the mouse pointer.
Method Detail
fromClientPosition(element, clientX, clientY)
Updates the position represented within this state object by the given
element and clientX/clientY coordinates (commonly available within event
objects). Position is translated from clientX/clientY (relative to
viewport) to element-relative coordinates.
- Parameters:
- {Element} element
- The element the coordinates should be relative to.
- {Number} clientX
- The X coordinate to translate, viewport-relative.
- {Number} clientY
- The Y coordinate to translate, viewport-relative.