Updating Hotkeys
How to update hotkeys at runtime
You can update hotkeys using the Update()
method. It works the same way as string replacement where you provide the current string and its replacement option:
Hotkey updates can occur even when the application is running. However, something important you need to note is that always use variables to store hotkeys since in this way, whenever an update to the hotkey occurs, it will automagically be detected in the HotkeyPressed
event.
Here's what I mean:
This will ensure that both the hotkey and its variable have been updated to reflect the changes made. This design is especially handy if your application saves user settings after update.
Here's another classical example of updating a hotkey:
Last updated