Constructor
new MouseTracker(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Allows configurable properties to be entirely specified by passing
an options object to the constructor. The constructor also supports
the original positional arguments 'element', 'clickTimeThreshold',
and 'clickDistThreshold' in that order.
Properties
|
- Source:
Members
clickDistThreshold :Number
The maximum distance allowed between a pointer down event and a pointer up event
to be treated as a click gesture.
Type:
- Number
- Source:
clickTimeThreshold :Number
The number of milliseconds within which a pointer down-up event combination
will be treated as a click gesture.
Type:
- Number
- Source:
dblClickDistThreshold :Number
The maximum distance allowed between two pointer click events
to be treated as a double-click gesture.
Type:
- Number
- Source:
dblClickTimeThreshold :Number
The number of milliseconds within which two pointer down-up event combinations
will be treated as a double-click gesture.
Type:
- Number
- Source:
element :Element
The element for which pointer events are being monitored.
Type:
- Element
- Source:
Methods
blurHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
clickHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
contextMenuHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
dblClickHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
destroy()
Clean up any events or objects created by the tracker.
- Source:
dragEndHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
dragHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
enterHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
exitHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Deprecated:
- v2.5.0 Use leaveHandler instead
- Source:
focusHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
getActivePointerCount() → {Number}
Returns the total number of pointers currently active on the tracked element.
- Source:
Returns:
- Type
- Number
getActivePointersListByType(type) → {OpenSeadragon.MouseTracker.GesturePointList}
Returns the
GesturePointList
for the given pointer device type,
creating and caching a new GesturePointList
if one doesn't already exist for the type.
Parameters:
Name | Type | Description |
---|---|---|
type |
String | The pointer device type: "mouse", "touch", "pen", etc. |
- Source:
Returns:
isTracking() → {Boolean}
Are we currently tracking events on this element.
- Deprecated:
- Just use this.tracking
- Source:
Returns:
Are we currently tracking events on this element.
- Type
- Boolean
keyDownHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
keyHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
keyUpHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
leaveHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Since:
- v2.5.0
- Source:
moveHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
nonPrimaryPressHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
nonPrimaryReleaseHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
outHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Since:
- v2.5.0
- Source:
overHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Since:
- v2.5.0
- Source:
pinchHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
preProcessEventHandler(eventInfo)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description |
---|---|---|
eventInfo |
OpenSeadragon.MouseTracker.EventProcessInfo |
- Source:
pressHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
releaseHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
scrollHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
setTracking(track) → {OpenSeadragon.MouseTracker}
Enable or disable whether or not we are tracking events on this element.
Parameters:
Name | Type | Description |
---|---|---|
track |
Boolean | True to start tracking, false to stop tracking. |
- Source:
Returns:
Chainable.
stopHandler(event)
Implement or assign implementation to these handlers during or after
calling the constructor.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object |
Properties
|
- Source:
Type Definitions
EventProcessInfo
Used for the processing/disposition of DOM events (propagation, default handling, capture, etc.)
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
eventSource |
OpenSeadragon.MouseTracker | A reference to the tracker instance. |
originalEvent |
Object | The original DOM event object. |
eventPhase |
Number | 0 == NONE, 1 == CAPTURING_PHASE, 2 == AT_TARGET, 3 == BUBBLING_PHASE. |
eventType |
String | "keydown", "keyup", "keypress", "focus", "blur", "contextmenu", "gotpointercapture", "lostpointercapture", "pointerenter", "pointerleave", "pointerover", "pointerout", "pointerdown", "pointerup", "pointermove", "pointercancel", "wheel", "click", "dblclick". |
pointerType |
String | "mouse", "touch", "pen", etc. |
isEmulated |
Boolean | True if this is an emulated event. If true, originalEvent is either the event that caused the emulated event, a synthetic event object created with values from the actual DOM event, or null if no DOM event applies. Emulated events can occur on eventType "wheel" on legacy mouse-scroll event emitting user agents. |
isStoppable |
Boolean | True if propagation of the event (e.g. bubbling) can be stopped with stopPropagation/stopImmediatePropagation. |
isCancelable |
Boolean | True if the event's default handling by the browser can be prevented with preventDefault. |
defaultPrevented |
Boolean | True if the event's default handling has already been prevented by a descendent element. |
preventDefault |
Boolean | Set to true to prevent the event's default handling by the browser. |
preventGesture |
Boolean | Set to true to prevent this MouseTracker from generating a gesture from the event. Valid on eventType "pointerdown". |
stopPropagation |
Boolean | Set to true prevent the event from propagating to ancestor/descendent elements on capture/bubble phase. |
shouldCapture |
Boolean | (Internal Use) Set to true if the pointer should be captured (events (re)targeted to tracker element). |
shouldReleaseCapture |
Boolean | (Internal Use) Set to true if the captured pointer should be released. |
userData |
Object | Arbitrary user-defined object. |
- Since:
- v2.5.0
- Source:
GesturePoint
Represents a point of contact on the screen made by a mouse cursor, pen, touch, or other pointer device.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
Number | Identifier unique from all other active GesturePoints for a given pointer device. |
type |
String | The pointer device type: "mouse", "touch", "pen", etc. |
captured |
Boolean | True if events for the gesture point are captured to the tracked element. |
isPrimary |
Boolean | True if the gesture point is a master pointer amongst the set of active pointers for each pointer type. True for mouse and primary (first) touch/pen pointers. |
insideElementPressed |
Boolean | True if button pressed or contact point initiated inside the screen area of the tracked element. |
insideElement |
Boolean | True if pointer or contact point is currently inside the bounds of the tracked element. |
speed |
Number | Current computed speed, in pixels per second. |
direction |
Number | Current computed direction, expressed as an angle counterclockwise relative to the positive X axis (-pi to pi, in radians). Only valid if speed > 0. |
contactPos |
OpenSeadragon.Point | The initial pointer contact position, relative to the page including any scrolling. Only valid if the pointer has contact (pressed, touch contact, pen contact). |
contactTime |
Number | The initial pointer contact time, in milliseconds. Only valid if the pointer has contact (pressed, touch contact, pen contact). |
lastPos |
OpenSeadragon.Point | The last pointer position, relative to the page including any scrolling. |
lastTime |
Number | The last pointer contact time, in milliseconds. |
currentPos |
OpenSeadragon.Point | The current pointer position, relative to the page including any scrolling. |
currentTime |
Number | The current pointer contact time, in milliseconds. |
- Source: