I want the clicking to pause when you press xbutton1
and it to continue when I press xbutton2
.
Here's my code:
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()