cteamx/Thief-Book-VSCode

可以使用python的pynput 监听鼠标 这样就不用每次按组合按键了 通过鼠标左键 下一页 右键关闭

zhangjie45 opened this issue · 0 comments

import pynput
from pynput.keyboard import Controller, Key, Listener
from pynput.mouse import Button

def on_click(x, y, button, pressed):
# 实例化键盘
kb = Controller()

# 使用键盘输入一个字母
kb.press(Key.ctrl)
kb.press(Key.alt)
kb.press('.')
kb.release(Key.ctrl)
kb.release(Key.alt)
kb.release('.')
kb.pressed(Key.ctrl,Key.alt,'.')
if button == Button.right:
    print("关闭")
    return False

with pynput.mouse.Listener(
on_click=on_click,) as listener:
listener.join()