Button Events: Difference between revisions

Button events are a generalized event system for all button interactions.
Table formatting
Line 38: Line 38:
! Component !! Hover Events !! Press Events !! Notes
! Component !! Hover Events !! Press Events !! Notes
|-
|-
| [[Button (Component)|Button]] || {{Yes}} || {{Yes}} ||
| [[Component:Button|Button]] || {{Yes}} || {{Yes}} ||
|-
|-
| [[ButtonHoverEventRelay (Component)|ButtonHoverEventRelay]] || {{Yes}} || {{No}} || Relays button hover events to a specifiable slot instead of its own.
| [[Component:ButtonHoverEventRelay|ButtonHoverEventRelay]] || {{Yes}} || {{No}} || Relays button hover events to a specifiable slot instead of its own.
|-
|-
| [[ButtonPressEventRelay (Component)|ButtonPressEventRelay]] || {{No}} || {{Yes}} || Relays button press events to a specifiable slot instead of its own.
| [[Component:ButtonPressEventRelay|ButtonPressEventRelay]] || {{No}} || {{Yes}} || Relays button press events to a specifiable slot instead of its own.
|-
|-
| [[LegacyButton (Component)|LegacyButton]] || {{No}} || {{Yes}} || Only supports '''Pressed''' and '''Released''', not '''Pressing'''.
| [[Component:LegacyButton|LegacyButton]] || {{No}} || {{Yes}} || Only supports '''Pressed''' and '''Released''', not '''Pressing'''.
|-
|-
| [[PhysicalButton (Component)|PhysicalButton]] || {{No}} || {{Yes}} ||
| [[Component:PhysicalButton|PhysicalButton]] || {{No}} || {{Yes}} ||
|-
|-
| [[TouchButton (Component)|TouchButton]] || {{No}} || {{Yes}} ||
| [[Component:TouchButton|TouchButton]] || {{No}} || {{Yes}} ||
|}
|}



Revision as of 00:33, 30 January 2024

Button events provide a generalized system for buttons and actions triggered by buttons within Resonite. This abstraction allows components to define behaviors as responses to common button interactions without having to know the specific button the interaction originates from. When a button event sender component triggers an event, it will call all corresponding button event receiver components on a single target slot, which is usually the same one it is attached to. Button events do not traverse hierarchies in the same way Dynamic Impulses do.

You can use button events in ProtoFlux by using the Button Events node.

The order in which multiple button event receiver components on the same slot are executed is not defined, as the order of components on a slot itself isn't defined and may change. If order of execution is important, consider using ProtoFlux instead!

Event Types

Button events are separated into two categories, each defining 3 event types:

Hover Events
Hover Enter
Hover Stay
Hover Leave
Press Events
Pressed
Pressing
Released

Components that act as receivers for either or both of those event categories implement IButtonPressReceiver and IButtonHoverReceiver respectively.

Button Event Data

Each button event carries event data with information about the interaction the event originates from.

Property Name Property Type
Source Component
Global Press Point Float3
Local Press Point Float2
Normalized Press Point Float2

Button Event Senders

Component Hover Events Press Events Notes
Button Yes Yes
ButtonHoverEventRelay Yes No Relays button hover events to a specifiable slot instead of its own.
ButtonPressEventRelay No Yes Relays button press events to a specifiable slot instead of its own.
LegacyButton No Yes Only supports Pressed and Released, not Pressing.
PhysicalButton No Yes
TouchButton No Yes

Button Event Receivers

Component Hover Events Press Events Notes
AudioStreamSpawner No Yes
AvatarCreatorSpawner No Yes
ButtonActionTrigger No Yes
ButtonAudioClipPlayer Yes Yes
ButtonAudioDeviceSet No Yes
ButtonClipboardCopyText No Yes
ButtonDelegateRelay´1 No Yes
ButtonDestroy No Yes
ButtonDynamicImpulseTrigger Yes Yes
ButtonDynamicImpulseTriggerWithReference´1 Yes Yes
ButtonDynamicImpulseTriggerWithValue´1 Yes Yes
ButtonEditColorX No Yes
ButtonEnumShift´1 No Yes
ButtonHoverEventRelay Yes No
ButtonHoverRelay Yes No
ButtonLoopSet Yes Yes
ButtonOpenHome No Yes
ButtonParentUnderUser No Yes
ButtonPlaybackAction Yes Yes
ButtonPlaybackSeeker No Yes
ButtonPressEventRelay No Yes
ButtonReferenceCycle´1 No Yes
ButtonReferenceSet´1 No Yes
ButtonRefRelay´1 No Yes
ButtonRelay´1 No Yes
ButtonRelay No Yes
ButtonStringAppend No Yes
ButtonStringErase No Yes
ButtonToggle No Yes
ButtonUserProfileIconSet No Yes
ButtonValueCycle´1 No Yes
ButtonValueSet´1 No Yes
ButtonValueShift´1 No Yes
ButtonWorldLink No Yes
ContactLink No Yes
ContextMenuItem Yes Yes
ContextMenuItemSource Yes Yes Despite not being a button event sender itself, it implements IButton and can therefore be used with the Button Events ProtoFlux node. (It will proxy all button events it receives.)
ContextMenuSubmenu No Yes
DataPreset No Yes
FileSystemItem No Yes
FullBodyCalibratorSpawner No Yes
GenericModalDialogSpawner´1 No Yes
GenericUserspaceDialogSpawner´1 No Yes
Hyperlink No Yes
InspectorMemberActions No Yes
InteractiveCameraSpawner No Yes
InventoryItemUI No Yes
RadiantDashButton No Yes
SlotRecord No Yes
Checkbox No Yes
Expander No Yes
Perspective360Panner Yes No
Radio No Yes
TextField No Yes
VirtualCloseKey No Yes
VirtualKey No Yes
VirtualModifierKey No Yes
VirtualMultiKey No Yes
VirtualShift No Yes
WorldCloseAction No Yes
WorldThumbnailItem Yes Yes