Reputation: 71
I'm looking to make a bot for a game via on-screen keyboard.
Is it possible to make pyautogui execute only on the on-screen keyboard and no other window?
Is there any way to map the buttons into shortcuts that I can easily call.
Upvotes: 0
Views: 348
Reputation: 11681
You can use the locateOnScreen()
function to find the coordinates of a button using a screenshot.
Window-specific functions are on the Roadmap (via PyGetWindow), but not implemented in pyautogui yet.
You may be able to check that the coordinates returned by locateOnScreen()
are within your desired window if you can get the window's rectangle coordinates in some other way, like by calling PyGetWindow's getWindowsWithTitle()
function yourself.
Upvotes: 0