schlosrat / token-health

FoundryVTT module
5 stars 10 forks source link

Improvement to Escape behavior #2

Closed apoapostolov closed 4 years ago

apoapostolov commented 4 years ago

If user presses ESC while the focus is on the value field, close the window rather than just losing focus. Currently user must press ESC twice to close the window.

tonifisler commented 4 years ago

This is actually the exact behaviour intended by the "Fix ESC key" option from plutonium:

Bind the "Escape" key to (in this order): de-select active input fields; de-select selected canvas elements; close context menus; close individual windows in most-recently-active-first order; toggle the main menu.

I have to make sure to override the same class function after plutonium. It seems hard to control the order in which all modules Hooks.on('ready') get fired 🤔

Norc commented 4 years ago

For what it's worth, in my latest test with foundry 0.5.5 and Token Health 0.1.5, pressing escape only once was needed to close the window.

tonifisler commented 4 years ago

Closing this, Giddy will improve ESC key handling in plutonium directly.