code: def process_keystroke(self, inp, idx, offset):
          
          if inp.lower() in (u'q', u'Q'):
              # exit
              return (-1, -1)
          self._process_keystroke_commands(inp)
          idx, offset = self._process_keystroke_movement(inp, idx, offset)
          return idx, offset
docs: Process keystroke ``inp``, adjusting screen parameters.
  
          :param inp: return value of Terminal.inkey().
          :type inp: blessed.keyboard.Keystroke
          :param idx: page index.
          :type idx: int
          :param offset: scrolling region offset of current page.
          :type offset: int
          :returns: tuple of next (idx, offset).
          :rtype: (int, int)