Python PyQt5.QtCore.Qt 模块,Key_L() 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用PyQt5.QtCore.Qt.Key_L()

项目:COMTool    作者:Neutree    | 项目源码 | 文件源码
def keyPressEvent(self, event):
        if event.key() == Qt.Key_Control:
            self.keyControlPressed = True
        elif event.key() == Qt.Key_Return or event.key()==Qt.Key_Enter:
            if self.keyControlPressed:
                self.sendData()
        elif event.key() == Qt.Key_L:
            if self.keyControlPressed:
                self.sendArea.clear()
        elif event.key() == Qt.Key_K:
            if self.keyControlPressed:
                self.receiveArea.clear()
        return
项目:SiebenApp    作者:ahitrin    | 项目源码 | 文件源码
def keyPressEvent(self, event):
        key_handlers = {
            Qt.Key_1: self.select_number(1),
            Qt.Key_2: self.select_number(2),
            Qt.Key_3: self.select_number(3),
            Qt.Key_4: self.select_number(4),
            Qt.Key_5: self.select_number(5),
            Qt.Key_6: self.select_number(6),
            Qt.Key_7: self.select_number(7),
            Qt.Key_8: self.select_number(8),
            Qt.Key_9: self.select_number(9),
            Qt.Key_0: self.select_number(0),
            Qt.Key_A: self.start_edit(self.goals.add, 'Add new goal'),
            Qt.Key_C: self.with_refresh(self.goals.toggle_close),
            Qt.Key_D: self.with_refresh(self.goals.delete),
            Qt.Key_I: self.start_edit(self.goals.insert, 'Insert new goal'),
            Qt.Key_L: self.with_refresh(self.goals.toggle_link),
            Qt.Key_Q: self.quit_app.emit,
            Qt.Key_R: self.start_edit(self.goals.rename, 'Rename goal'),
            Qt.Key_S: self.with_refresh(self.goals.swap_goals),
            Qt.Key_V: self.toggle_view,
            Qt.Key_Z: self.toggle_zoom,
            Qt.Key_Escape: self.cancel_edit,
            Qt.Key_Space: self.with_refresh(self.goals.hold_select),
        }
        if event.key() in key_handlers:
            key_handlers[event.key()]()
        else:
            super().keyPressEvent(event)
项目:pyqt5    作者:yurisnm    | 项目源码 | 文件源码
def set_up_keyboard_keys(self):

        row_1 = [Qt.Key_Q, Qt.Key_W, Qt.Key_E, Qt.Key_R, Qt.Key_T, Qt.Key_Y,
                 Qt.Key_Y, Qt.Key_I, Qt.Key_O, Qt.Key_P, Qt.Key_Backspace]
        row_2 = [Qt.Key_A, Qt.Key_S, Qt.Key_D, Qt.Key_F, Qt.Key_G, Qt.Key_H,
                 Qt.Key_J, Qt.Key_K, Qt.Key_L, Qt.Key_Ccedilla, Qt.Key_Return]
        row_3 = [Qt.Key_Aring, Qt.Key_Z, Qt.Key_X, Qt.Key_C, Qt.Key_V,
                 Qt.Key_B, Qt.Key_N, Qt.Key_M, Qt.Key_Comma, Qt.Key_Period,
                 Qt.Key_Question, Qt.Key_Aring]
        row_4 = [Qt.Key_Aring, Qt.Key_Space,
                 Qt.Key_Left, Qt.Key_Right, Qt.Key_Aring]
        self.keyboard_keys = [row_1, row_2, row_3, row_4]