Skip to main content

Class: TouchPad<P>

A touchscreen pad which tracks mouse drag motions.

Type parameters

NameType
Pextends TouchPadProps = TouchPadProps

Hierarchy

  • DisplayComponent<P>

    TouchPad

Constructors

constructor

new TouchPad<P>(props): TouchPad<P>

Creates an instance of a DisplayComponent.

Type parameters

NameType
Pextends TouchPadProps = TouchPadProps

Parameters

NameTypeDescription
propsPThe propertis of the component.

Returns

TouchPad<P>

Inherited from

DisplayComponent<P>.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

DisplayComponent.context

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [] = undefined

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType

Defined in

src/sdk/components/FSComponent.ts:67


cssClassSub

Protected Optional cssClassSub: Subscription

Defined in

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


currentMousePosition

Protected Readonly currentMousePosition: Float64Array

Defined in

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


dragInhibitThresholdPx

Protected Readonly dragInhibitThresholdPx: number

Defined in

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


dragLockFocusThresholdPx

Protected Readonly dragLockFocusThresholdPx: number

Defined in

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


focusOnDrag

Protected Readonly focusOnDrag: boolean

Defined in

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


inhibitOnDrag

Protected Readonly inhibitOnDrag: boolean

Defined in

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


inhibitOnDragAxis

Protected Readonly inhibitOnDragAxis: "both" | "x" | "y"

Defined in

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


instrumentMouseLeaveSub

Protected Optional instrumentMouseLeaveSub: Subscription

Defined in

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


isEnabled

Protected Readonly isEnabled: Subscribable<boolean> | Subscribable<false> | Subscribable<true>

Defined in

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


isEnabledSub

Protected Optional isEnabledSub: Subscription

Defined in

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


isFocusLocked

Protected isFocusLocked: boolean = false

Defined in

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


isPrimed

Protected isPrimed: boolean = false

Defined in

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


isVisible

Protected Readonly isVisible: Subscribable<boolean> | Subscribable<false> | Subscribable<true>

Defined in

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


isVisibleSub

Protected Optional isVisibleSub: Subscription

Defined in

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


lastTickMousePosition

Protected Readonly lastTickMousePosition: Float64Array

Defined in

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


lastTickTime

Protected lastTickTime: undefined | number = undefined

Defined in

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


lockFocusOnDrag

Protected Readonly lockFocusOnDrag: boolean

Defined in

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


lockFocusOnDragAxis

Protected Readonly lockFocusOnDragAxis: "both" | "x" | "y"

Defined in

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


mouseDownListener

Protected Readonly mouseDownListener: (e: MouseEvent) => void

Type declaration

▸ (e): void

Responds to mouse down events on this pad's root element.

Parameters
NameTypeDescription
eMouseEventThe mouse event.
Returns

void

Defined in

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


mouseDownPosition

Protected Readonly mouseDownPosition: Float64Array

Defined in

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


mouseLeaveListener

Protected Readonly mouseLeaveListener: (e?: MouseEvent) => void

Type declaration

▸ (e?): void

Responds to mouse leave events.

Parameters
NameTypeDescription
e?MouseEventThe mouse event, or undefined if the mouse left the instrument window.
Returns

void

Defined in

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


mouseMoveListener

Protected Readonly mouseMoveListener: (e: MouseEvent) => void

Type declaration

▸ (e): void

Responds to mouse move events.

Parameters
NameTypeDescription
eMouseEventThe mouse event.
Returns

void

Defined in

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


mouseUpListener

Protected Readonly mouseUpListener: () => void

Type declaration

▸ (): void

Responds to mouse up events.

Returns

void

Defined in

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


prevMousePosition

Protected Readonly prevMousePosition: Float64Array

Defined in

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


props

props: P & ComponentProps

The properties of the component.

Inherited from

DisplayComponent.props

Defined in

src/sdk/components/FSComponent.ts:61


rootCssClass

Protected Readonly rootCssClass: SetSubject<string>

Defined in

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


rootRef

Protected Readonly rootRef: NodeReference<HTMLDivElement>

Defined in

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


sliderContainerRef

Protected Readonly sliderContainerRef: NodeReference<HTMLDivElement>

Defined in

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


sliderThumbRef

Protected Readonly sliderThumbRef: NodeReference<HTMLDivElement>

Defined in

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


tickInterval

Protected tickInterval: null | Timer = null

Defined in

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


DEFAULT_SNAP_ANIMATION_EASING

Static Protected Readonly DEFAULT_SNAP_ANIMATION_EASING: (start: number, stop: number, progress: number) => number

Type declaration

▸ (start, stop, progress): number

Parameters
NameType
startnumber
stopnumber
progressnumber
Returns

number

Defined in

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


RESERVED_CSS_CLASSES

Static Protected Readonly RESERVED_CSS_CLASSES: Set<string>

Defined in

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

Methods

destroy

destroy(): void

Returns

void

Inherit Doc

Overrides

DisplayComponent.destroy

Defined in

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


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
contextneverThe context to get the subscription for.

Returns

never

The requested context.

Throws

An error if no data for the specified context type could be found.

Inherited from

DisplayComponent.getContext

Defined in

src/sdk/components/FSComponent.ts:106


getDragDistance

getDragDistance(axis, initialPos): number

Get the distance that the mouse has been dragged along an axis relative to an initial position.

Parameters

NameTypeDescription
axis"both" | "x" | "y"The axis along which to measure the distance.
initialPosReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The initial mouse position.

Returns

number

The distance that the mouse has been dragged along the specified axis relative to the specified initial position.

Defined in

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


getReservedCssClasses

getReservedCssClasses(): ReadonlySet<string>

Gets the CSS classes that are reserved for this pad's root element.

Returns

ReadonlySet<string>

The CSS classes that are reserved for this pad's root element.

Defined in

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


onAfterRender

onAfterRender(node): void

Parameters

NameType
nodeVNode

Returns

void

Inherit Doc

Overrides

DisplayComponent.onAfterRender

Defined in

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


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


onMouseDown

onMouseDown(e): void

Responds to mouse down events on this pad's root element.

Parameters

NameTypeDescription
eMouseEventThe mouse event.

Returns

void

Defined in

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


onMouseLeave

onMouseLeave(e?): void

Responds to mouse leave events.

Parameters

NameTypeDescription
e?MouseEventThe mouse event, or undefined if the mouse left the instrument window.

Returns

void

Defined in

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


onMouseMove

onMouseMove(e): void

Responds to mouse move events.

Parameters

NameTypeDescription
eMouseEventThe mouse event.

Returns

void

Defined in

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


onMouseUp

onMouseUp(): void

Responds to mouse up events.

Returns

void

Defined in

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


render

render(): VNode

Returns

VNode

Inherit Doc

Overrides

DisplayComponent.render

Defined in

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


setFocusLocked

setFocusLocked(isFocusLocked): void

Sets the focus lock state of this pad.

Parameters

NameTypeDescription
isFocusLockedbooleanThe new focus lock state.

Returns

void

Defined in

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


setPrimed

setPrimed(isPrimed): void

Sets the primed state of this pad.

Parameters

NameTypeDescription
isPrimedbooleanThe new primed state.

Returns

void

Defined in

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


tickFunc

tickFunc(): void

Returns

void

Defined in

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