def handleEvents(self, args):
if isinstance(args, MouseEvent):
if args.current_key == 'LButton' and args.event_type == 'key down':
self.mouseX = args.mouse_x
self.mouseY = args.mouse_y
self.xAndY = win32api.GetCursorPos()
if args.current_key == 'LButton' and args.event_type == 'key up':
if self.mouseX != args.mouse_x or self.mouseY != args.mouse_y:
keyboard.press_and_release('ctrl+c')
# if isinstance(args, KeyboardEvent):
# if 'control' in args.current_key and args.event_type == 'key down':
# self.ctrlDown = True
# if 'control' in args.current_key and args.event_type == 'key up':
# self.ctrlDown = False
# if args.current_key == 'C' and self.ctrlDown:
# if self.sysCopy:
# pass
# else:
# self.allowCopy = True
# down = False
# def handleEvents(args):
# global down
# if isinstance(args, MouseEvent):
# if args.current_key == 'LButton' and args.event_type == 'key up':
# keyboard.press_and_release('ctrl+c')
# if isinstance(args, KeyboardEvent):
# if 'control' in args.current_key and args.event_type == 'key down':
# down = True
# if 'control' in args.current_key and args.event_type == 'key up':
# down = False
# if args.current_key == 'C' and down:
# print(1)
# def onClipboardChanged()
# data = clipboard.mimeData()
# if data.hasText():
# print(data.text())
# app = QApplication([])
# clipboard = app.clipboard()
# clipboard.dataChanged.connect(onClipboardChanged)
评论列表
文章目录