asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

Validation for inserted button value on click() #718

Open LeonardoFerrari opened 2 years ago

LeonardoFerrari commented 2 years ago

There's no validation of the value passed as argument for the button parameter in the click() function. I added a conditional to check if it's a string. If so, it'll lower the 'button', if not (number) it'll ignore the .lower() assignment.