Refactor hotkey-handling methods.