本文整理汇总了Python中PyQt5.QtCore.Qt.Key_J方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Key_J方法的具体用法?Python Qt.Key_J怎么用?Python Qt.Key_J使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Key_J方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_J [as 别名]
def __init__(self, ui):
super().__init__(ui)
self.ui.pushButton_join.clicked.connect(self.joinTraj)
self.ui.pushButton_split.clicked.connect(self.splitTraj)
#SHORTCUTS
self.ui.pushButton_join.setShortcut(QKeySequence(Qt.Key_J))
self.ui.pushButton_split.setShortcut(QKeySequence(Qt.Key_S))
示例2: keyPressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_J [as 别名]
def keyPressEvent(self, e):
if e.modifiers() == Qt.ControlModifier and e.key() == Qt.Key_F:
text, okPressed = QInputDialog.getText(self, "Find", "Find what: ")
self.setSelectionBackgroundColor(QColor("#6be585"))
if okPressed:
if text == "":
text = " "
self.dialog.noMatch(text)
self.searchtext = text
"""
This is the way to implement a search function using QScintilla
http://pyqt.sourceforge.net/Docs/QScintilla2/classQsciScintilla.html#a37ac2bea94eafcfa639173557a821200
"""
if self.findFirst(
self.searchtext, False, True, False, True, True, -1, -1, True, False
):
pass
else:
self.dialog.noMatch(self.searchtext)
if e.key() == Qt.Key_F3:
self.findNext()
self.setSelectionBackgroundColor(QColor("#6be585"))
if e.modifiers() == Qt.ControlModifier and e.key() == Qt.Key_L:
self.setCursorPosition(self.line, self.column + 1)
return
if e.modifiers() == Qt.ControlModifier and e.key() == 77:
self.setCursorPosition(self.line + 1, self.column)
return
if e.modifiers() == Qt.ControlModifier and e.key() == Qt.Key_J:
self.setCursorPosition(self.line, self.column - 1)
if e.modifiers() == Qt.ControlModifier and e.key() == Qt.Key_I:
self.setCursorPosition(self.line - 1, self.column)
if e.modifiers() == Qt.ControlModifier and e.key() == Qt.Key_T:
self.parent.parent.realterminal()
return
super().keyPressEvent(e)
示例3: keyPressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_J [as 别名]
def keyPressEvent(self, event):
print(event.key())
if event.key() == Qt.Key_M:
self.send_flag = False
self.com.write(b"m")
self.send_flag = False
elif event.key() == Qt.Key_Return or event.key()==Qt.Key_Enter:
self.send_flag = False
self.com.write(b"m")
self.send_flag = False
elif event.key() == Qt.Key_N or event.key() == 92:
self.send_flag = False
self.com.write(b"n")
self.send_flag = False
elif event.key() == Qt.Key_Minus:
self.send_flag = False
self.com.write(b"-")
self.send_flag = False
elif event.key() == Qt.Key_Equal:
self.send_flag = False
self.com.write(b"=")
self.send_flag = False
elif event.key() == Qt.Key_W or event.key() == Qt.Key_Up:
self.send_flag = True
self.key.append(b"w")
elif event.key() == Qt.Key_A or event.key() == Qt.Key_Left:
self.send_flag = True
self.key.append(b"a")
elif event.key() == Qt.Key_S or event.key() == Qt.Key_Down:
self.send_flag = True
self.key.append(b"s")
elif event.key() == Qt.Key_D or event.key() == Qt.Key_Right:
self.send_flag = True
self.key.append(b"d")
elif event.key() == Qt.Key_J:
self.send_flag = True
self.key.append(b"j")
elif event.key() == Qt.Key_K:
self.send_flag = True
self.key.append(b"k")
elif event.key() == Qt.Key_Escape:
self.send_flag = False
self.com.write(b"\x03")
elif event.key() == Qt.Key_Control:
self.keyControlPressed = True
elif event.key() == Qt.Key_C:
if self.keyControlPressed:
self.send_flag = False
self.com.write(b"\x03")
# self.key_label.setText(self.key.decode())