Interface: TouchPadProps
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:9
Component props for TouchPad.
Extends
ComponentProps
Properties
bus?
optional
bus: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?
optional
children:DisplayChildren
[]
Defined in: src/sdk/components/FSComponent.ts:122
The children of the display component.
Inherited from
ComponentProps.children
class?
optional
class:string
|SubscribableSet
<string
>
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:123
CSS class(es) to apply to the pad's root element.
dragInhibitThresholdPx?
optional
dragInhibitThresholdPx: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?
optional
dragLockFocusThresholdPx: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?
optional
focusOnDrag: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?
optional
inhibitOnDrag: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?
optional
inhibitOnDragAxis:"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?
optional
isEnabled: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?
optional
isVisible:boolean
|Subscribable
<boolean
>
Defined in: src/garminsdk/components/touchpad/TouchPad.tsx:74
Whether the pad is visible. Defaults to true
.
lockFocusOnDrag?
optional
lockFocusOnDrag: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?
optional
lockFocusOnDragAxis:"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()?
optional
onDestroy: () =>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()?
optional
onDragEnded: <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()?
optional
onDragMoved: <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()?
optional
onDragStarted: <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()?
optional
onDragTick: <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 , "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?
optional
ref:NodeReference
<any
>
Defined in: src/sdk/components/FSComponent.ts:125
A reference to the display component.
Inherited from
ComponentProps.ref