new Touchscreen(element)
Provides cross-browser absolute touch event translation for a given element.
Touch events are translated into mouse events as if the touches occurred
on a touchscreen (tapping anywhere on the screen clicks at that point,
long-press to right-click).
Parameters:
Name | Type | Description |
---|---|---|
element |
Element | The Element to use to provide touch events. |
Members
clickMoveThreshold
The maximum number of pixels to allow a touch to move for the gesture to
be considered a click.
clickTimingThreshold
The maximum number of milliseconds to wait for a touch to end for the
gesture to be considered a click.
currentState :Guacamole.Mouse.State
The current mouse state. The properties of this state are updated when
mouse events fire. This state object is also passed in as a parameter to
the handler of any mouse events.
Type:
longPressThreshold
The amount of time a press must be held for long press to be
detected.
scrollThreshold
The distance a two-finger touch must move per scrollwheel event, in
pixels.
Events
onmousedown
Fired whenever a mouse button is effectively pressed. This can happen
as part of a "mousedown" gesture initiated by the user by pressing one
finger over the touchscreen element, as part of a "scroll" gesture
initiated by dragging two fingers up or down, etc.
Parameters:
Name | Type | Description |
---|---|---|
state |
Guacamole.Mouse.State | The current mouse state. |
onmousemove
Fired whenever the user moves the mouse by dragging their finger over
the touchscreen element. Note that unlike Guacamole.Mouse.Touchpad,
dragging a finger over the touchscreen element will always cause
the mouse button to be effectively down, as if clicking-and-dragging.
Parameters:
Name | Type | Description |
---|---|---|
state |
Guacamole.Mouse.State | The current mouse state. |
onmouseup
Fired whenever a mouse button is effectively released. This can happen
as part of a "mouseup" gesture initiated by the user by removing the
finger pressed against the touchscreen element, or as part of a "scroll"
gesture initiated by dragging two fingers up or down, etc.
Parameters:
Name | Type | Description |
---|---|---|
state |
Guacamole.Mouse.State | The current mouse state. |