Skip to main content

Interface: TouchPadProps

Component props for TouchPad.

Hierarchy

  • ComponentProps

    TouchPadProps

Properties

bus

Optional bus: EventBus

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.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:15


children

Optional children: DisplayChildren[]

The children of the display component.

Inherited from

ComponentProps.children

Defined in

src/sdk/components/FSComponent.ts:122


class

Optional class: string | SubscribableSet<string>

CSS class(es) to apply to the pad's root element.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:123


dragInhibitThresholdPx

Optional dragInhibitThresholdPx: number

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.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:117


dragLockFocusThresholdPx

Optional dragLockFocusThresholdPx: number

The distance, in pixels, the mouse must click and drag before the pad locks focus. Ignored if lockFocusOnDrag is false. Defaults to 0 pixels.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:98


focusOnDrag

Optional focusOnDrag: boolean

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.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:80


inhibitOnDrag

Optional inhibitOnDrag: boolean

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.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:105


inhibitOnDragAxis

Optional inhibitOnDragAxis: "both" | "x" | "y"

The axis along which dragging will trigger the inhibit function. Ignored if inhibitOnDrag is false. Defaults to 'both'.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:111


isEnabled

Optional isEnabled: boolean | Subscribable<boolean>

Whether the pad is enabled, or a subscribable which provides it. Disabled touchpads cannot be interacted with. Defaults to true.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:71


isVisible

Optional isVisible: boolean | Subscribable<boolean>

Whether the pad is visible. Defaults to true.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:74


lockFocusOnDrag

Optional lockFocusOnDrag: boolean

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.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:86


lockFocusOnDragAxis

Optional lockFocusOnDragAxis: "both" | "x" | "y"

The axis along which dragging will trigger the lock focus function. Ignored if lockFocusOnDrag is false. Defaults to 'both'.

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:92


onDestroy

Optional onDestroy: () => void

A callback function which will be called when the pad is destroyed.

Type declaration

▸ (): void

A callback function which will be called when the pad is destroyed.

Returns

void

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:120


onDragEnded

Optional onDragEnded: <T>(position: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, initialPosition: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, pad: T) => void

A function which is called when a drag motion ends.

Param

The current position of the mouse.

Param

The position of the mouse at the start of the drag motion.

Param

The pad.

Type declaration

▸ <T>(position, initialPosition, pad): void

A function which is called when a drag motion ends.

Type parameters
NameType
Textends TouchPad<TouchPadProps> = TouchPad<TouchPadProps>
Parameters
NameTypeDescription
positionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The current position of the mouse.
initialPositionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the mouse at the start of the drag motion.
padTThe pad.
Returns

void

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:61


onDragMoved

Optional onDragMoved: <T>(position: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, prevPosition: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, initialPosition: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, pad: T) => void

A function which is called when the mouse is moved during a drag motion.

Param

The current position of the mouse.

Param

The position of the mouse at the previous update.

Param

The position of the mouse at the start of the current drag motion.

Param

The pad.

Type declaration

▸ <T>(position, prevPosition, initialPosition, pad): void

A function which is called when the mouse is moved during a drag motion.

Type parameters
NameType
Textends TouchPad<TouchPadProps> = TouchPad<TouchPadProps>
Parameters
NameTypeDescription
positionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The current position of the mouse.
prevPositionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the mouse at the previous update.
initialPositionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the mouse at the start of the current drag motion.
padTThe pad.
Returns

void

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:31


onDragStarted

Optional onDragStarted: <T>(position: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, pad: T) => void

A function which is called when a drag motion starts.

Param

The current position of the mouse.

Param

The pad.

Type declaration

▸ <T>(position, pad): void

A function which is called when a drag motion starts.

Type parameters
NameType
Textends TouchPad<TouchPadProps> = TouchPad<TouchPadProps>
Parameters
NameTypeDescription
positionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The current position of the mouse.
padTThe pad.
Returns

void

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:22


onDragTick

Optional onDragTick: <T>(position: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, prevPosition: undefined | Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, initialPosition: Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>, dt: number, pad: T) => void

A function which is called every frame when a drag motion is active.

Param

The current position of the mouse.

Param

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.

Param

The position of the mouse at the start of the current drag motion.

Param

The elapsed time, in milliseconds, since the previous frame.

Param

The pad.

Type declaration

▸ <T>(position, prevPosition, initialPosition, dt, pad): void

A function which is called every frame when a drag motion is active.

Type parameters
NameType
Textends TouchPad<TouchPadProps> = TouchPad<TouchPadProps>
Parameters
NameTypeDescription
positionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The current position of the mouse.
prevPositionundefined | 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.
initialPositionReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the mouse at the start of the current drag motion.
dtnumberThe elapsed time, in milliseconds, since the previous frame.
padTThe pad.
Returns

void

Defined in

src/garminsdk/components/touchpad/TouchPad.tsx:47


ref

Optional ref: NodeReference<any>

A reference to the display component.

Inherited from

ComponentProps.ref

Defined in

src/sdk/components/FSComponent.ts:125