Removing Hotkeys

Easily removing hotkeys at runtime

To remove a hotkey, we use the Remove() method. This method has two variants:

Remove(): This accepts a single hotkey or an array of hotkeys.

RemoveAll(): This removes all the registered hotkeys.

Below are some examples:

// Remove a single hotkey.
hkl.Remove(hotkey1);
// Let's use an array of already registered hotkeys.
Hotkey[] hotkeys = new Hotkey[] 
{ 
    new Hotkey(Keys.Alt, Keys.E), 
    new Hotkey(Keys.Alt, Keys.J) 
};

// Remove the array of hotkeys.
hkl.Remove(hotkeys);
// This will remove all the registered hotkeys.
hkl.RemoveAll();

Last updated