Button Events

From Resonite Wiki
Revision as of 20:36, 16 January 2024 by JackTheFoxOtter (talk | contribs) (Added initial version of Button Events page, this isn't final yet, I'll refine this tomorrow.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 rely on knowing which specific button was the source of the interaction. When a button event source component triggers an event, it will call all corresponding button event handler 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.

Template:Warning

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 the C# interfaces IButtonPressReceiver and IButtonHoverReceiver respectively.

You can create ProtoFlux Impulses for the different event types by using the Button Events (ProtoFlux) node.

Button Event Data

Each button event carries event data with information about the interaction that resulted in the event.

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

Button Event Sources

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

Button Event Handlers

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