code: def qteKeyPress(self, msgObj):
          
          # Unpack the data structure.
          (srcObj, keysequence, macroName) = msgObj.data
          key = keysequence.toQKeyEventList()[-1]
  
          # If the current key did not complete a macro ignore it.
          if macroName is None:
              return
  
          if self.input_complete:
              # The user has terminated reading digits by calling this
              # macro directly, ie. the 'macroName ==
              # self.qteMacroName()' branch below ran previously.
              self.qteRepeatTheMacro(msgObj)
          elif (macroName == 'self-insert') and (key.text().isdigit()):
              # User typed a digit.
              self.repeat_cnt += key.text()
          elif macroName == self.qteMacroName():
              # User called us again. This completes reading the
              # digits. The next macro is executed self.prefix_num
              # times.
              self.input_complete = True
          else:
              # If we got until here we know that a macro is supposed to
              # be executed, that it is not the self-insert macro for a
              # digit, and that it was not another call to this macro to
              # complete the input explicitly.
              self.qteRepeatTheMacro(msgObj)
docs: Record the key presses reported by the key handler.