ItemPushButton
- Last UpdatedFeb 21, 2024
- 2 minute read
The ItemPushButton implements a pushbutton to trigger an action.
-
The ItemPushButton inherits from Item.
Platform support
This node is fully supported on XR-Windows platform.
It is partially supported on XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Partial support |
Partial support |
Partial support |
Partial support |
|
|
|
|
|
|
PushButton modes
The PushButton has these modes.
|
Mode |
Description |
|---|---|
|
Normal |
The normal button is a two state button. The user presses one time to set the button as pressed, and presses again to release. |
|
Autoreturn |
The autoreturn button automatically releases when the user releases the action button. |
Code example
This is a code example for ItemPushButton.
<ItemPushButton name="HS52151" />
Default actions
|
Action |
Hotkey |
Text |
Description |
|---|---|---|---|
|
push |
X |
Push |
Pushes button (also performs release for normal buttons). |
ItemPushButton fields
These are the fields for ItemPushButton node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > NodeBaseMovable > Item > ItemPushButton
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
autoReturnDelay |
sfloat |
Optional |
1 |
The minimum pressure interval. It can be used to avoid spikes on pressure. |
|
buttonMesh |
sstring |
Optional |
Auto-populated |
Name of the button mesh. Can be overridden if the item does not support naming convention. |
|
buttonPressed |
sevent |
Read only |
Not set |
Raised when button is pressed. |
|
buttonReleased |
sevent |
Read only |
Not set |
Raised when button is released. |
|
currentPosition |
sfloat |
Read only |
Internally calculated |
Position of the button along the axis. |
|
mode |
senum |
Optional |
Autoreturn |
Defines selector mode: Normal or Autoreturn. |
|
pushSpeed |
sfloat |
Optional |
5 |
Animation speed. |
|
statesPosition |
mfloat |
Optional |
0,-0.01 |
Defines the two positions of the push button (offsets along the pivot axis). |
|
value |
sint |
Optional |
0 |
Defines the state of the item: 0 for released, 1 per pressed. |