Suspending Hotkey Selection Forms

How to suspend hotkey-selection on certain forms e.g. a Settings form at runtime

Whenever you're dealing with selection of hotkeys at runtime, you also need to take into account that all hotkeys are still active and so changing the keys may be difficult. Due to this, the hotkeys need to be disabled whenever a user opens the Form where the hotkey selection controls are hosted.

With this need comes the method SuspendOn() that allows suspension of all registered hotkeys once a form hosting the hotkey-selection controls is opened. This will allow the user to update any specific hotkey without unnecessarily invoking it:

// Call the method using our last HotkeySelector instance.
hkl.SuspendOn(form2);

Last updated