Button Events: Difference between revisions

Button events are a generalized event system for all button interactions.
Table formatting
add line breaks to make intro more readable
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{SHORTDESC:Button events are a generalized event system for all button interactions.}}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|slot]], which is usually the same one it is attached to. Button events '''do not''' traverse hierarchies in the same way [[Dynamic Impulses]] do.
{{SHORTDESC:Button events are a generalized event system for all button interactions.}}
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|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 (ProtoFlux)|Button Events node]].
You can use button events in [[ProtoFlux]] by using the [[Button Events (ProtoFlux)|Button Events node]].
Line 38: Line 43:
! 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}} ||
|}
|}


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

Latest revision as of 23:59, 4 June 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