config.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:AlphaHooks 作者: AlphaHooks 项目源码 文件源码
def eventFilter(self, source, event):

        # Console Input
        if source is self.ui.console_input:
            if event.type() == QEvent.KeyPress:
                if event.key() in (Qt.Key_Enter, Qt.Key_Return):
                    command = self.ui.console_input.text()
                    if command != "":
                        readline.add_history(
                            command
                        )
                    self.length = readline.get_current_history_length()
                    self.index = -1

                if event.key() == Qt.Key_Up:
                    if self.index < self.length:
                        self.index += 1
                        command = readline.get_history_item(
                            self.length - self.index
                        )
                        self.ui.console_input.setText(
                            command
                        )

                if event.key() == Qt.Key_Down:
                    if self.index > 0:
                        self.index -= 1
                        command = readline.get_history_item(
                            self.length - self.index
                        )

                        self.ui.console_input.setText(
                            command
                        )

            return False
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号