code: def keyPressEvent(self, ev):
      if ev.key() == QtCore.Qt.Key.Key_Up:
          if self.ptr < len(self.history) - 1:
              self.setHistory(self.ptr + 1)
              ev.accept()
              return
      elif ev.key() == QtCore.Qt.Key.Key_Down:
          if self.ptr > 0:
              self.setHistory(self.ptr - 1)
              ev.accept()
              return
      elif ev.key() in (
          QtCore.Qt.Key.Key_Return,
          QtCore.Qt.Key.Key_Enter,
      ):
          self.execCmd()
      else:
          super().keyPressEvent(ev)
          self.history[0] = self.text()
  
file_path: pyqtgraph/pyqtgraph/console/CmdInput.py
imports: from ..Qt import QtCore, QtWidgets
label_desc: Use image node_id 3 for calling the CmdInput obj's underlying member method code with example usage: obj.keyPressEvent(ev) without return types