我希望在您按下时单击暂停,xbutton1
并在按下时继续单击xbutton2
。
这是我的代码:
import win32api
import win32con
import pyautogui
click = True
def clicking():
get = win32api.GetKeyState(win32con.VK_LBUTTON)
if get < 1:
pyautogui.click()
def stop():
if win32api.GetKeyState(win32con.VK_XBUTTON1):
click = False
def continue_program():
if win32api.GetKeyState(win32con.VK_XBUTTON2):
click = True
while True:
if click == True:
clicking()
else:
stop()