imahitman
imahitman

Reputation: 71

Using pyautogui exclusively for on-screen keyboard

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

Answers (1)

gilch
gilch

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

Related Questions