def METHOD_NAME(self):
    iomediator.CURRENT_INTERFACE.ungrab_keyboard()
    if self in IoMediator.listeners:
        IoMediator.listeners.remove(self)
        if self.insideKeys:
            self.target_parent.end_key_sequence()
        self.insideKeys = False