In my Hololens 2 app I want to add a context menu to each hologram that the user can open by touching the hologram for 2 seconds. It should basically look like this:
https://learn.microsoft.com/en-us/dynamics365/mixed-reality/guides/media/touch-dwell-animation.gif
(Source: https://learn.microsoft.com/en-us/dynamics365/mixed-reality/guides/authoring-gestures-hl2)
But I cannot find any code examples for this. Do you have any ideas what I need to add for this or any piece of documentation?
The Interactable component can meet your request, it will catch input actions and funnel these interactions into events to responsive. To make this possible, the Interactable component provides different types of out-of-box event receivers to respond to different types of input. Among them, InteractableOnHoldReceiver is used to trigger after pressing Interactable for a period. For how to add the event receiver into the Interactable please see Events