def _resolve_button(button: Union[str, int]) -> str:
    """
    Resolve a string of a button name to a canonical name used for AHK script
    :param button:
    :type button: str
    :return:
    """
    if isinstance(button, str):
        button = button.lower()

    if button in _BUTTONS:
        resolved_button = _BUTTONS[button]
    elif isinstance(button, int) and button > 3:
        #  for addtional mouse buttons
        resolved_button = f'X{button - 3}'
    else:
        assert isinstance(button, str)
        resolved_button = button
    return resolved_button

    Resolve a string of a button name to a canonical name used for AHK script
    :param button:
    :type button: str
    :return:
    
ahk/_async/engine.py