Interface: TouchButtonProps
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:80
Component props for TouchButton.
Extends
Properties
children?
optional
children:DisplayChildren
[]
Defined in: sdk/components/FSComponent.ts:122
The children of the display component.
Inherited from
class?
optional
class:string
|SubscribableSet
<string
>
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:200
CSS class(es) to apply to the button's root element.
dragThresholdPx?
optional
dragThresholdPx:number
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:188
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.
focusOnDrag?
optional
focusOnDrag:boolean
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:163
Whether the button should focus all mouse events when dragging and the button is primed or held, preventing the
events from bubbling up to any ancestors in the DOM tree. Defaults to false
.
inhibitOnDrag?
optional
inhibitOnDrag:boolean
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:182
Whether the button should stop responding to mouse events and instead forward them to its parent after clicking
and dragging for a certain distance defined by dragThresholdPx
along the axis defined by inhibitOnDragAxis
.
When mouse events are inhibited, the button cannot be primed or held. Defaults to false
.
inhibitOnDragAxis?
optional
inhibitOnDragAxis:"both"
|"y"
|"x"
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:194
The axis along which dragging will trigger the inhibit function. Ignored if inhibitOnDrag
is false
.
Defaults to 'both'
.
isActive?
optional
isActive:boolean
|Subscribable
<boolean
>
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:99
Whether the button is considered to be "active".
When true, the touch-button-active
css class will be applied, giving it a cyan border and dark grey background.
Defaults to false
.
isEnabled?
optional
isEnabled:boolean
|Subscribable
<boolean
>
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:85
Whether the button is enabled, or a subscribable which provides it. Disabled buttons cannot be touched, primed,
pressed, or held. Defaults to true
.
isHighlighted?
optional
isHighlighted:boolean
|Subscribable
<boolean
>
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:92
Whether the button is highlighted, or a subscribable which provides it.
When true, the touch-button-highlight
css class will be applied, making the button cyan with black font.
Defaults to false
.
isInList?
optional
isInList:boolean
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:169
Whether the button is in a scrollable list. If true
, will enable the inhibit on drag function unless otherwise
specified by the inhibitOnDrag
prop. Defaults to false
.
isVisible?
optional
isVisible:boolean
|Subscribable
<boolean
>
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:102
Whether the button is visible. Defaults to true
.
label?
optional
label:string
|VNode
|Subscribable
<string
>
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:111
The label for the button. Can be defined as either a static string
, a subscribable which provides the label
string
, or a VNode. If not defined, the button will not have a label.
If the label is defined as a VNode, all first-level DisplayComponents in the VNode tree will be destroyed when the button is destroyed.
listScrollAxis?
optional
listScrollAxis:"y"
|"x"
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:175
The scroll axis of the button's parent list. Ignored if isInList
is false
. Sets the button's inhibit on drag
axis unless otherwise specified by the inhibitOnDragAxis
prop. Defaults to y
.
onDestroy()?
optional
onDestroy: () =>void
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:197
A callback function which will be called when the button is destroyed.
Returns
void
onHoldEnded()?
optional
onHoldEnded: <B
>(button
,totalHoldDuration
,endReason
) =>void
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:157
A function which is called when the button exits the held state.
Type Parameters
Type Parameter | Default type |
---|---|
B extends TouchButton <TouchButtonProps > | TouchButton <TouchButtonProps > |
Parameters
Parameter | Type | Description |
---|---|---|
button | B | The button that was held. |
totalHoldDuration | number | The total amount of time, in milliseconds, that the button was held. |
endReason | TouchButtonHoldEndReason | The reason that the button exited the held state. |
Returns
void
onHoldStarted()?
optional
onHoldStarted: <B
>(button
) =>TouchButtonHoldAction
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:137
A function which is called when the button enters the held state. If not defined, then the button will default to taking no specific action when it enters the held state.
Type Parameters
Type Parameter | Default type |
---|---|
B extends TouchButton <TouchButtonProps > | TouchButton <TouchButtonProps > |
Parameters
Parameter | Type | Description |
---|---|---|
button | B | The button that is held. |
Returns
The action to take. Ignored if the value is equal to TouchButtonHoldAction.EndHold.
onHoldTick()?
optional
onHoldTick: <B
>(button
,dt
,totalTime
,timeSinceLastPress
) =>TouchButtonHoldAction
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:149
A function which is called every frame when the button is held. If not defined, then the button will default to taking no specific action with each frame tick.
Type Parameters
Type Parameter | Default type |
---|---|
B extends TouchButton <TouchButtonProps > | TouchButton <TouchButtonProps > |
Parameters
Parameter | Type | Description |
---|---|---|
button | B | The button that is held. |
dt | number | The elapsed time, in milliseconds, since the previous frame. |
totalTime | number | The total amount of time, in milliseconds, that the button has been held. |
timeSinceLastPress | number | The amount of time, in milliseconds, that the button has been held since the last time the button was pressed as a tick action. |
Returns
The action to take.
onMouseEnter()?
optional
onMouseEnter: () =>void
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:129
A callback function which will be called every time the cursor enters the button.
Returns
void
onPressed()?
optional
onPressed: <B
>(button
,isHeld
) =>void
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:126
A callback function which will be called every time the button is pressed.
Type Parameters
Type Parameter | Default type |
---|---|
B extends TouchButton <TouchButtonProps > | TouchButton <TouchButtonProps > |
Parameters
Parameter | Type | Description |
---|---|---|
button | B | The button that was pressed. |
isHeld | boolean | Whether the button was held when it was pressed. |
Returns
void
onTouched()?
optional
onTouched: <B
>(button
) =>TouchButtonOnTouchedAction
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:119
A callback function which will be called every time the button is touched (i.e. a mouse down event on the button is detected). If not defined, then the button will default to entering the primed state when touched.
Type Parameters
Type Parameter | Default type |
---|---|
B extends TouchButton <TouchButtonProps > | TouchButton <TouchButtonProps > |
Parameters
Parameter | Type | Description |
---|---|---|
button | B | The button that was touched. |
Returns
The action to take as a result of the button being touched.
ref?
optional
ref:NodeReference
<any
>
Defined in: sdk/components/FSComponent.ts:125
A reference to the display component.
Inherited from
variant
variant:
"base"
|"small"
|"bar"
|"bar-lime"
|"bar-tab"
|"bar-menu"
|"list-button"
Defined in: workingtitle-instruments-epic2/shared/Components/TouchButton.tsx:203
button style variant *