PyGB lets Python control the mouse and keyboard, and other GUI automation tasks. For Windows, macOS, and Linux, on Python 3 and 2.
Project description
PyGB
PyGB (Py-GUI-Background) is a fork of the PyAutoGUI to support background keyboard and mouse events to a specific window.
Getting Started
Everything is the same as in the original PyAutoGUI, except for each function you can add a window
argument to specify the window to send the event to (the window can be inactive, running in the background).
If the window
argument is not specified, the event will be sent to the global event tap (same as original PyAutoGUI).
import pygb
# Press key to a specific window
pygb.keyDown('a', window=859)
pygb.keyUp('a', window=859)
# Take screenshot of a specific window
img = pygb.screenshot('a', window=859)
Window APIs
pygb.getWindows()
- returns a list of windows with their title
Window resizing
win.resize(width, height)
- resize a window to a specific size: https://stackoverflow.com/questions/70535283/how-can-i-resize-terminal-window-from-python
References
- cocoa-vanilla: a Python library for building Cocoa GUIs on macOS
- ahk-python
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PyGB-0.9.54.tar.gz
(63.3 kB
view details)
File details
Details for the file PyGB-0.9.54.tar.gz
.
File metadata
- Download URL: PyGB-0.9.54.tar.gz
- Upload date:
- Size: 63.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63d61665219fcc36e209a4f3b1a5fff4a02d2fcf050e57b595fff4053ca9ab2e |
|
MD5 | 5c97d08efdccc14ddf55288245756771 |
|
BLAKE2b-256 | 21255a8495efa6e500c8350df151587a75b0d6a95651fe73315a41df74fee0a8 |