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.
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.
Using pyautogui exclusively for on-screen keyboard