本文整理汇总了Python中PyQt5.QtCore.Qt.Key_Control方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Key_Control方法的具体用法?Python Qt.Key_Control怎么用?Python Qt.Key_Control使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Key_Control方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _qtKeyToUMKey
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Control [as 别名]
def _qtKeyToUMKey(self, key):
if key == Qt.Key_Shift:
return KeyEvent.ShiftKey
elif key == Qt.Key_Control:
return KeyEvent.ControlKey
elif key == Qt.Key_Alt:
return KeyEvent.AltKey
elif key == Qt.Key_Space:
return KeyEvent.SpaceKey
elif key == Qt.Key_Meta:
return KeyEvent.MetaKey
elif key == Qt.Key_Enter or key == Qt.Key_Return:
return KeyEvent.EnterKey
elif key == Qt.Key_Up:
return KeyEvent.UpKey
elif key == Qt.Key_Down:
return KeyEvent.DownKey
elif key == Qt.Key_Left:
return KeyEvent.LeftKey
elif key == Qt.Key_Right:
return KeyEvent.RightKey
elif key == Qt.Key_Minus:
return KeyEvent.MinusKey
elif key == Qt.Key_Underscore:
return KeyEvent.UnderscoreKey
elif key == Qt.Key_Plus:
return KeyEvent.PlusKey
elif key == Qt.Key_Equal:
return KeyEvent.EqualKey
return key
示例2: keyPressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Control [as 别名]
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()
示例3: keyReleaseEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Control [as 别名]
def keyReleaseEvent(self,event):
if event.key() == Qt.Key_Control:
self.keyControlPressed = False
示例4: keyReleaseEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Control [as 别名]
def keyReleaseEvent(self,event):
if event.key() == Qt.Key_Control:
self.keyControlPressed = False
if len(self.key):
self.key.pop()
# self.key_label.setText("")
示例5: wheelEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Control [as 别名]
def wheelEvent(self, event):
delta = round(event.angleDelta().y()/120)
# zoom
if self.key == Qt.Key_Control:
self.set_zoom_delta(delta)
# width
elif self.key == Qt.Key_X:
if not self.lock_width:
self.set_width_delta(delta)
# offset (fine)
elif self.key == Qt.Key_Shift:
self.set_offset_delta(delta)
if self.get_sync_state():
ida_kernwin.jumpto(self.base + self.offs)
self.activateWindow()
self.setFocus()
elif self.key == Qt.Key_H:
if not self.lock_width:
less = delta < 0
w = -8 if less else 8
self.set_pixel_qty_per_line((self.get_pixel_qty_per_line() & 0xFFFFFFF8) + w)
# offset (coarse)
else:
self.set_offset_delta(delta * self.get_pixel_qty_per_line())
if self.get_sync_state():
ida_kernwin.jumpto(self.base + self.offs)
self.activateWindow()
self.setFocus()
self.statechanged.emit()
self.repaint()
return
示例6: keyPressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Control [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())
示例7: mouseMoveEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Control [as 别名]
def mouseMoveEvent(self, event):
x = event.pos().x()
y = event.pos().y()
within_graph = (x >= self.rect_x and x < self.rect_x + self.rect_x_width)
"""(sx1, sy1), (sx2, sy2) = self.slider_coords
on_slider = (x >= sx1 and x< sx2 and y>= sy1 and y < sy2)"""
update_state = self.is_dragging_graph or within_graph
if self.is_dragging_graph:
# zoom
if self.key == Qt.Key_Control:
self.set_zoom_delta(-1 if y > self.prev_mouse_y else 1)
# width
elif self.key == Qt.Key_X:
if not self.lock_width:
self.set_width_delta(-1 if y > self.prev_mouse_y else 1)
elif self.key == Qt.Key_H:
if not self.lock_width:
less = y > self.prev_mouse_y
delta = -16 if less else 16
self.set_pixel_qty_per_line((self.get_pixel_qty_per_line() & 0xFFFFFFF0) + delta)
# scrolling (offset)
elif y != self.prev_mouse_y:
# offset (fine)
delta = y - self.prev_mouse_y
# offset (coarse)
if self.key != Qt.Key_Shift:
delta *= self.get_pixel_qty_per_line()
self.set_offset_delta(delta)
elif within_graph:
self._update_mouse_coords(event.pos())
self.mouseOffs = self._get_offs_by_pos(event.pos())
if self.link_pixel and self.highlight_cursor:
highlight_item(ida_bytes.get_item_head(self.get_cursor_address()))
elif self.highlight_cursor:
unhighlight_item()
self.setToolTip(self.fm.on_get_tooltip(self.get_address(), self.get_pixel_qty(), self.mouseOffs))
if update_state:
self.prev_mouse_y = y
self.x = x
self.statechanged.emit()
self.repaint()
return