def processInput(self, key): if key == 'UP' or key == 'k': self.moveIndex(-1) elif key == 'DOWN' or key == 'j': self.moveIndex(1) elif key == 'c': self.beginEnterCommand() elif key == ' ' or key == 'PAGE_DOWN': self.pageDown() elif key == 'b' or key == 'PAGE_UP': self.pageUp() elif key == 'g': self.jumpToIndex(0) elif key == 'G': self.jumpToIndex(self.numMatches - 1) elif key == 'f': self.toggleSelect() elif key == 'A': self.toggleSelectAll() elif key == 'ENTER': 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.getFilesToUse() self.cursesAPI.exit() pass
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 == 'PAGE_DOWN': self.pageDown() elif key == 'b' or key == 'PAGE_UP': self.pageUp() elif key == 'g': self.jumpToIndex(0) elif key == 'G' and not self.mode == X_MODE: 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': 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.getFilesToUse() self.cursesAPI.exit() elif self.mode == X_MODE and key in lbls: self.selectXMode(key) pass
def processInput(self, key): if key == 'UP' or key == 'k': self.moveIndex(-1) elif key == 'DOWN' or key == 'j': self.moveIndex(1) elif key == 'c': self.beginEnterCommand() elif key == ' ' or key == 'PAGE_DOWN': self.pageDown() elif key == 'b' or key == 'PAGE_UP': self.pageUp() elif key == 'g': self.jumpToIndex(0) elif key == 'G': self.jumpToIndex(self.numMatches - 1) elif key == 'f': self.toggle_select() elif key == 'A': self.toggleSelectAll() elif key == 'ENTER': 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.getFilesToUse() sys.exit(0)
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 == 'd': self.describeFile() 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) for boundKey, command in self.keyBindings.bindings: if key == boundKey: self.executePreconfiguredCommand(command)
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 == "PAGE_DOWN": self.pageDown() elif key == "b" or key == "PAGE_UP": self.pageUp() elif key == "g": self.jumpToIndex(0) elif key == "G" and not self.mode == X_MODE: 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