hotkey_handler: add some helper functions to clean up syntax