I have tried to search google and other websites such as GitHub but I cant find a way to detect if the right key has been pressed. I am using the two modules Keyboard and Pyautogui to make a auto clicker but all the ideas that I have come up with have failed. Here is my code:
import keyboard
import pyautogui
pyautogui.PAUSE = 0.1
while True:
if keyboard.is_pressed('h'):
pyautogui.rightClick()
if keyboard.is_pressed('g'):
pyautogui.click()
I want a way to replace the h and g with right click and left click any ideas?