Remove hotkeys from buttons

Per this article: https://docs.webix.com/desktop__uimanager.html

I cannot disable hotkeys once set.

See: https://snippet.webix.com/4nm0hnr2

The only solution currently seems to be to remove the hotkeys globally:

webix.UIManager.removeHotKey(“esc”, null);
webix.UIManager.removeHotKey(“enter”, null);

And here is a simple example of why it is important for me to be able to disable hotkeys for buttons specifically. The bug occurs when one form1 is shown and hidden, then form2 is shown, then the “enter” key is pressed.

If there is a better way for me to be registering and unregistering these hotkeys for my use case, please let me know.

https://snippet.webix.com/nujp7jk2

Hello @zpetit ,

The only solution currently seems to be to remove the hotkeys globally

It is the correct solution, as the handler added with the hotkey property is global. Otherwise, it will exist until the source button is destroyed.

If you need to remove and re-attach the global handler for a different button, you need to destroy the previous handler (as you already did) and then define the new one which will invoke the click on a different button:

https://snippet.webix.com/eka5892f