def METHOD_NAME(self, keyboard, keycode, *args):
    """ The callback function that catches keyboard events. """
    # system keyboard keycode: (122, 'z')
    # dock keyboard keycode: 'z'
    if isinstance(keycode, tuple):
        keycode = keycode[1]
    self.displayLabel.text += u" (up {0})".format(keycode)