def remap_hotkey(src, dst, suppress=True, trigger_on_release=False):
def handler():<EOL><INDENT>active_modifiers = sorted(modifier for modifier, state in _listener.modifier_states.items() if state == '<STR_LIT>')<EOL>for modifier in active_modifiers:<EOL><INDENT>release(modifier)<EOL><DEDENT>send(dst)<EOL>for modifier in reversed(active_modifiers):<EOL><INDENT>press(modifier)<EOL><DEDENT>return False<EOL><DEDENT>return add_hotkey(src, handler, suppress=suppress, trigger_on_release=trigger_on_release)<EOL>
Whenever the hotkey `src` is pressed, suppress it and send
`dst` instead.

Example:

    remap('alt+w', 'ctrl+up')