Interface: TouchPadProps
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:9
Component props for TouchPad.
Extends
Properties
bus?
optionalbus:EventBus
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:15
The event bus. If defined, the touch pad will end drag motions when the mouse leaves the instrument window,
including when focus is locked. Requires the vc_mouse_leave topic from InstrumentEvents to be published
to the event bus.
children?
optionalchildren:DisplayChildren[]
Defined in: src/sdk/components/FSComponent.ts:122
The children of the display component.
Inherited from
class?
optionalclass:string|SubscribableSet<string>
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:123
CSS class(es) to apply to the pad's root element.
dragInhibitThresholdPx?
optionaldragInhibitThresholdPx:number
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:117
The distance, in pixels, the mouse can click and drag before the pad begins to ignore mouse events. Ignored if
inhibitOnDrag is false. Defaults to 40 pixels.
dragLockFocusThresholdPx?
optionaldragLockFocusThresholdPx:number
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:98
The distance, in pixels, the mouse must click and drag before the pad locks focus. Ignored if lockFocusOnDrag is
false. Defaults to 0 pixels.
focusOnDrag?
optionalfocusOnDrag:boolean
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:80
Whether the pad should focus all mouse events when dragging, preventing them from bubbling up to any ancestors
in the DOM tree. Defaults to false.
inhibitOnDrag?
optionalinhibitOnDrag:boolean
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:105
Whether the pad should stop responding to mouse events and instead forward them to its parent after clicking
and dragging for a certain distance defined by dragInhibitThresholdPx along the axis defined by
inhibitOnDragAxis. The inhibit function is disabled when focus is locked. Defaults to false.
inhibitOnDragAxis?
optionalinhibitOnDragAxis:"both"|"x"|"y"
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:111
The axis along which dragging will trigger the inhibit function. Ignored if inhibitOnDrag is false.
Defaults to 'both'.
isEnabled?
optionalisEnabled:boolean|Subscribable<boolean>
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:71
Whether the pad is enabled, or a subscribable which provides it. Disabled touchpads cannot be interacted with.
Defaults to true.
isVisible?
optionalisVisible:boolean|Subscribable<boolean>
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:74
Whether the pad is visible. Defaults to true.
lockFocusOnDrag?
optionallockFocusOnDrag:boolean
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:86
Whether the pad should lock focus when dragging, consuming mouse events for the entire document window instead
of just the pad's root element and disabling the inhibit function. Defaults to false.
lockFocusOnDragAxis?
optionallockFocusOnDragAxis:"both"|"x"|"y"
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:92
The axis along which dragging will trigger the lock focus function. Ignored if lockFocusOnDrag is false.
Defaults to 'both'.
onDestroy()?
optionalonDestroy: () =>void
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:120
A callback function which will be called when the pad is destroyed.
Returns
void
onDragEnded()?
optionalonDragEnded: <T>(position,initialPosition,pad) =>void
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:61
A function which is called when a drag motion ends.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends TouchPad<TouchPadProps> | TouchPad<TouchPadProps> |
Parameters
| Parameter | Type | Description |
|---|---|---|
position | ReadonlyFloat64Array | The current position of the mouse. |
initialPosition | ReadonlyFloat64Array | The position of the mouse at the start of the drag motion. |
pad | T | The pad. |
Returns
void
onDragMoved()?
optionalonDragMoved: <T>(position,prevPosition,initialPosition,pad) =>void
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:31
A function which is called when the mouse is moved during a drag motion.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends TouchPad<TouchPadProps> | TouchPad<TouchPadProps> |
Parameters
| Parameter | Type | Description |
|---|---|---|
position | ReadonlyFloat64Array | The current position of the mouse. |
prevPosition | ReadonlyFloat64Array | The position of the mouse at the previous update. |
initialPosition | ReadonlyFloat64Array | The position of the mouse at the start of the current drag motion. |
pad | T | The pad. |
Returns
void
onDragStarted()?
optionalonDragStarted: <T>(position,pad) =>void
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:22
A function which is called when a drag motion starts.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends TouchPad<TouchPadProps> | TouchPad<TouchPadProps> |
Parameters
| Parameter | Type | Description |
|---|---|---|
position | ReadonlyFloat64Array | The current position of the mouse. |
pad | T | The pad. |
Returns
void
onDragTick()?
optionalonDragTick: <T>(position,prevPosition,initialPosition,dt,pad) =>void
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:47
A function which is called every frame when a drag motion is active.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends TouchPad<TouchPadProps> | TouchPad<TouchPadProps> |
Parameters
| Parameter | Type | Description |
|---|---|---|
position | ReadonlyFloat64Array | The current position of the mouse. |
prevPosition | undefined | Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">> | The position of the mouse during the previous frame, or undefined if this is the first frame since the start of the current drag motion. |
initialPosition | ReadonlyFloat64Array | The position of the mouse at the start of the current drag motion. |
dt | number | The elapsed time, in milliseconds, since the previous frame. |
pad | T | The pad. |
Returns
void
ref?
optionalref:NodeReference<any>
Defined in: src/sdk/components/FSComponent.ts:125
A reference to the display component.