CodeTyper is a Python script that automatically types text copied to the clipboard with correct indentation. It is ideal for quickly typing out code snippets or other text without manual input.
- Automatically types text copied to the clipboard
- Maintains correct indentation
Before using CodeTyper, ensure you have the following dependencies installed:
- Python 3.x 🐍
- PyAutoGUI ⌨️
- Pyperclip 📋
- keyboard (for GUI version)
You can install the required Python packages using pip:
pip install pyautogui pyperclip keyboard-
Clone the repository:
git clone https://github.com/not-adarsh/CodeTyper
-
Navigate to the project directory:
cd CodeTyper -
Run the
main.pyscript:python main.py
-
The GUI will open. Copy the text you want to type.
-
Use the GUI controls to start/stop typing, pause/resume, or hide/unhide the window.
Keyboard Shortcuts:
F6: Start/Stop TypingF7: Pause/Resume TypingEsc: Stop TypingCtrl+Shift+X: Exit ProgramCtrl+Shift+M: Hide/Unhide the Program
If you prefer not to use the graphical interface, you can use the non-GUI script:
import pyperclip
import pyautogui
import time
def autotype_clipboard():
time.sleep(2) # Reduced delay before starting
clipboard_text = pyperclip.paste().split("\n")
for line in clipboard_text:
pyautogui.write(line, interval=0.005) # Reduced interval for faster typing
for char in line:
if char in ["[", '"', "'", "("]:
pyautogui.press("delete")
pyautogui.press("enter")
pyautogui.press("home")
if __name__ == "__main__":
autotype_clipboard()-
Clone the repository:
git clone https://github.com/not-adarsh/CodeTyper
-
Navigate to the project directory:
cd CodeTyper -
Run the
noGUImain.pyscript:python noGUImain.py
-
Copy the text you want to type.
-
The program will automatically type the copied text with correct indentation.
The original script was conceived and developed by our college seniors, who created the non-GUI version. Their work served as the foundation for this project. I built upon their efforts by developing a GUI to enhance usability and accessibility. Their pioneering contributions laid the groundwork for CodeTyper, and I am grateful for their support.
Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.