def keyPressEvent(self,e):
        iren = None
        if self.mRenWin:
            iren = self.mRenWin.GetInteractor()

        if (not iren) or (not iren.GetEnabled()):
            return

        ascii_key = None
        if e.text().length()>0:
            ascii_key = e.text().toLatin1()[0]
        else:
            ascii_key = chr(0)

        keysym = self.ascii_to_key_sym(ord(ascii_key))

        if not keysym:
            keysym = self.qt_key_to_key_sym(e.key())

        # Ignore 'q' or 'e' or Ctrl-anykey
        ctrl = (e.modifiers()&QtCore.Qt.ControlModifier)
        shift = (e.modifiers()&QtCore.Qt.ShiftModifier)
        if (keysym in ['q', 'e'] or ctrl):
            e.ignore()
            return
        
        iren.SetKeyEventInformation(ctrl,shift,ascii_key, e.count(), keysym)

        iren.InvokeEvent("KeyPressEvent")

        if ascii_key:
            iren.InvokeEvent("CharEvent")
Make ApiConfigManager with a few helpful fakes.
dataset/ETHPy150Open VisTrails/VisTrails/contrib/titan/vtkviewcell.py/QVTKViewWidget.keyPressEvent--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/endpoints/api_config_manager_test.py/ApiConfigManagerTest.setUp