Page 1 of 1

Custom Widget react on "ESC" Key

Posted: Fri Oct 22, 2021 3:10 am
by mprattinger
Hi,

we have created a widget which we use as the topbar in our screens. Now we want to react when the user presses the "ESC"-Key and run code which is in the widget.
I can attach to the keyevent but it seems that the ESC and all the F-keys are catched by pui and is not bubbled up to my event listener.
Is there a way, how we can register to these keypresses too?

Thanks,
Michael

Re: Custom Widget react on "ESC" Key

Posted: Mon Oct 25, 2021 2:47 pm
by Scott Klement
You would use the addEvent() function to add a keyup or keydown event to the screen https://docs.profoundlogic.com/x/KQAy and the removeEvent() routine to remove it later. https://docs.profoundlogic.com/x/KwAy

Profound UI does not block these events from propagating ("bubbling up")