Type text and emojis character-by-character using clipboard paste.
Project description
Pacetype 🐢
Simulates typing text, including emojis and special characters, with adjustable delays for specific characters. Uses pyautogui.typewrite() for speed with standard characters and the clipboard for robust cross-platform compatibility with complex characters (like emojis) that often cause issues with direct key simulation.
🤔 Why Pacetype?
Automating keyboard input with libraries like pyautogui can be fast for standard text but tricky when dealing with emojis or complex Unicode characters. Direct key simulation (pyautogui.typewrite) doesn't always handle these complex characters correctly across different OSs and input methods. Conversely, simulating copy-paste for every character is reliable but slower.
pacetype offers a hybrid approach:
- It detects standard, printable characters and types them rapidly using
pyautogui.typewrite(). - When it encounters a complex character (emoji, symbol, non-printable), it switches to the clipboard method:
- Copies the single complex character to the system clipboard.
- Simulates the standard "paste" keyboard shortcut (Ctrl+V or Cmd+V).
- Waits for a specified
interval(if provided) only after pasting a complex character.
This hybrid method provides the speed of typewrite for normal text and the reliability of the clipboard for special characters.
🚀 Installation
pip install pacetype
✨ Simple Usage
Using pacetype is straightforward. Just import it and call it directly with the text you want to type.
import pacetype
import time
# Give yourself a moment to switch to the target window
print("Pacetyping in 3 seconds...")
time.sleep(3)
# Type text with complex characters. Delay only applies after 👋 and 🐢.
# Standard characters are typed quickly.
pacetype("Hello World! 👋 Fast standard text. Slow emoji... 🐢", interval=0.5)
# Type text rapidly (no interval delay for clipboard pastes)
pacetype("Typing emojis quickly! ✅🚀", interval=0.0)
# Type standard text very fast (uses typewrite, interval is ignored)
pacetype("This uses pyautogui.typewrite and is fast.", interval=0.5) # interval has no effect here
print("Typing finished!")
Key Points:
- Hybrid Typing: Standard characters are typed using the fast
pyautogui.typewrite(interval=0). Complex characters (emojis, etc.) are pasted via the clipboard. - Conditional Delay: The
intervalargument (defaulting to0.0) applies only as atime.sleep()pause after a complex character has been pasted using the clipboard. It does not affect the speed of standard character typing. - Clipboard for Complexity: The clipboard method ensures greater reliability for emojis and a wide range of special characters that
typewritemight fail on.
⚙️ Features
- Hybrid Typing: Fast typing for standard text, reliable clipboard pasting for complex characters.
- Emoji & Unicode Support: Reliably types emojis and complex characters via the clipboard.
- Conditional Delay: Control paste speed for complex characters with the optional
intervalargument. - Simple Callable API: Just
import pacetypeand usepacetype("your text", interval=...). - Cross-Platform: Works on Windows, macOS, and Linux (thanks to
pyperclipandpyautogui).
⚠️ Important Notes
- Window Focus: The target application window (e.g., text editor, browser, chat) must have keyboard focus when
pacetype()is executing. - Clipboard Use: Pacetype uses the system clipboard when pasting complex characters. Any content you manually copy while it's pasting such a character might be overwritten. The clipboard will contain the last complex character pasted after the script finishes. Standard typing does not affect the clipboard.
- Keyboard Shortcuts: Assumes standard
Ctrl+V(Windows/Linux) orCmd+V(macOS) paste shortcuts are active.
🤝 Contributing
Contributions, issues, and feature requests are welcome!
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pacetype-0.3.0.tar.gz.
File metadata
- Download URL: pacetype-0.3.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
805a012d8ee7b6847c6e14acc7ba8e95d740efd2b9ca6e6c9a2c21ec01e8c032
|
|
| MD5 |
33ed150a59c0e58b3030e2a507b51d4d
|
|
| BLAKE2b-256 |
42c5c036a25d22660ddba0f54d573730ecb77817f1baa72624be45043a276a9a
|
File details
Details for the file pacetype-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pacetype-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf0491b599f16ac1b7ed60f4c0bbef9a9efb69f30ec1fe80dc64496bc450a63
|
|
| MD5 |
0be4b93b4fff29c46110ba568686e0b9
|
|
| BLAKE2b-256 |
e2b9e04a206b1063f75e3e740eec2c8960b0be6125086c9441536bab1cfb826d
|