code: def timerEvent(self, event):
          self.killTimer(event.timerId())
          if event.timerId() == self._qteTimerRunMacro:
              self._qteTimerRunMacro = None
              while True:
                  if len(self._qteMacroQueue) > 0:
                      (macroName, qteWidget, event) = self._qteMacroQueue.pop(0)
                      self._qteRunQueuedMacro(macroName, qteWidget, event)
                  elif len(self._qteKeyEmulationQueue) > 0:
                      if self._qteActiveApplet is None:
                          receiver = self.qteActiveWindow()
                      else:
                          if self._qteActiveApplet._qteActiveWidget is None:
                              receiver = self._qteActiveApplet
                          else:
                              receiver = self._qteActiveApplet._qteActiveWidget
                      keysequence = self._qteKeyEmulationQueue.pop(0)
                      self._qteEventFilter.eventFilter(receiver, keysequence)
                  else:
                      self._qteFocusManager()
                      break
                  self._qteFocusManager()
          elif event.timerId() == self.debugTimer:
              pass
          else:
              print('Unknown timer ID')
              pass