@staticmethod
def get_key_hash(key):
    """Return the hash for the given key."""
    if key.joystick:
        return '{}:{} {}'.format(key.joystick, key.keytype, key.number)
    else:
        return '{} {}'.format(key.keytype, key.number)
