code: def stop(self):
          
          self.state = False
          with display_manager(self.display) as d:
              d.record_disable_context(self.ctx)
              d.ungrab_keyboard(X.CurrentTime)
          with display_manager(self.display2):
              d.record_disable_context(self.ctx)
              d.ungrab_keyboard(X.CurrentTime)
docs: Stop listening for keyboard input events.