def processInput(self, key):
        if key == 'UP' or key == 'k':
            self.moveIndex(-1)
        elif key == 'DOWN' or key == 'j':
            self.moveIndex(1)
        elif key == 'x':
            self.toggleXMode()
        elif key == 'c':
            self.beginEnterCommand()
        elif key == ' ' or key == 'NPAGE':
            self.pageDown()
        elif key == 'b' or key == 'PPAGE':
            self.pageUp()
        elif key == 'g' or key == 'HOME':
            self.jumpToIndex(0)
        elif (key == 'G' and not self.mode == X_MODE) or key == 'END':
            self.jumpToIndex(self.numMatches - 1)
        elif key == 'f':
            self.toggleSelect()
        elif key == 'F':
            self.toggleSelect()
            self.moveIndex(1)
        elif key == 'A' and not self.mode == X_MODE:
            self.toggleSelectAll()
        elif key == 'ENTER' and (not self.flags.getAllInput() or len(self.flags.getPresetCommand())):
            # it does not make sense to process an 'ENTER' keypress if we're in the allInput
            # mode and there is not a preset command.
            self.onEnter()
        elif key == 'q':
            output.outputNothing()
            # this will get the appropriate selection and save it to a file for reuse
            # before exiting the program
            self.getPathsToUse()
            self.cursesAPI.exit()
        elif self.mode == X_MODE and key in lbls:
            self.selectXMode(key)
        pass
dataset/ETHPy150Open facebook/PathPicker/src/screenControl.py/Controller.processInput/original