How to deal with global event?
ndaidong opened this issue · 3 comments
ndaidong commented
Hi there,
I want to change app state once user presses ESC key. How to call action on that?
I can not find any tutorial relating to this popular use case.
Thanks,
selfup commented
In the subscription documentation there is a global event listener (window) that deals with listening to key presses: https://github.com/jorgebucaran/hyperapp/blob/main/docs/reference.md#subscriptions
ndaidong commented
@selfup ah thank you, that's my mistake. I need to reload the document system here.
selfup commented
All good!