@classmethod
def to_keyname(cls, key):
    """Return this key as a string keyname.

          * Format is "{minus}{keytype} {number}".
          * Hat format is "{keytype} {number} {hat_name}"

        Examples
            * "Axis 0" - For Axis 0 with a positive or 0 value.
            * "-Axis 1" - For an Axis Key that has a negative value and needs to be inverted.
            * "Button 0" - Buttons wont have negative values
            * "Hat 0 [Left Up]" - Hat values also give the key value as a hat name.
        """
    prefix = ''
    if key.value and key.value < 0:
        prefix = '-'
    if key.keytype == cls.HAT:
        return '{}{} {} [{}]'.format(prefix, key.keytype, key.number, key.
            get_hat_name())
    else:
        return '{}{} {}'.format(prefix, key.keytype, key.number)
