code: def _process_keystroke_movement(self, inp, idx, offset):
          
          term = self.term
          if inp in (u'y', u'k') or inp.code in (term.KEY_UP,):
              # scroll backward 1 line
              idx, offset = (idx, offset - self.screen.num_columns)
          elif inp in (u'e', u'j') or inp.code in (term.KEY_ENTER,
                                                   term.KEY_DOWN,):
              # scroll forward 1 line
              idx, offset = (idx, offset + self.screen.num_columns)
          elif inp in (u'f', u' ') or inp.code in (term.KEY_PGDOWN,):
              # scroll forward 1 page
              idx, offset = (idx + 1, offset)
          elif inp == u'b' or inp.code in (term.KEY_PGUP,):
              # scroll backward 1 page
              idx, offset = (max(0, idx - 1), offset)
          elif inp.code in (term.KEY_SDOWN,):
              # scroll forward 10 pages
              idx, offset = (max(0, idx + 10), offset)
          elif inp.code in (term.KEY_SUP,):
              # scroll forward 10 pages
              idx, offset = (max(0, idx - 10), offset)
          elif inp.code == term.KEY_HOME:
              # top
              idx, offset = (0, 0)
          elif inp.code == term.KEY_END:
              # bottom
              idx, offset = (self.last_page, 0)
          return idx, offset
docs: Process keystrokes that adjust index and offset.