- Home /
fire OnSubmit when key released
Hi,
is there any way to fire the button OnSubmit event on release and not on press?
Answer by ranch000 · Sep 13, 2019 at 12:21 PM
Add an EventTrigger component to your Button. Add a new pointer up event to to this. Finally add the listener that you want to this event type. ( The button component itself should not have any onclick listener attached)
Sorry for not being clear. I meant submit event (enter, spacebar) There is PointerUp event but no SubmitUp. I've managed to do what I needed with starting a coroutine inside this event and cheching for Input.any$$anonymous$$ey but I was wondering if there's a more elegant way.
Your answer
Follow this Question
Related Questions
A lack of basic understanding of events and such 1 Answer
Which game object is calling my script? 0 Answers
Parent Event Handler Overriding Child Handler 0 Answers
Setting up EventTrigger programmatically for GameObject throws NullReferenceException 0 Answers
Where is the best place to use delegate call back without calling it in Update function? 1 Answer