|
1 | 1 | # SimpleKeyClicker |
2 | 2 |
|
3 | | -A powerful and user-friendly GUI automation tool for simulating keyboard and mouse inputs. Built with Python and ttkbootstrap. Perfect for gaming macros, testing, or automating repetitive input tasks. |
4 | | - |
| 3 | +A powerful and user-friendly GUI automation tool for simulating keyboard and mouse inputs. Built with Python and **CustomTkinter** for a stunning modern dark UI. Perfect for gaming macros, testing, or automating repetitive input tasks. |
5 | 4 |
|
6 | 5 |  |
7 | 6 |
|
8 | | -## Features |
9 | | - |
10 | | -- 🎮 **Action Sequencing**: Create and run sequences of keyboard presses and mouse actions. |
11 | | -- ⏱️ **Customizable Timing**: Set delays *after* each action and specify hold durations for keys/mouse buttons. |
12 | | -- 🔄 **Repetition Control**: Choose to run sequences **indefinitely** or for a **specific number of times**. |
13 | | -- 🎨 **Theme Support**: Toggle between **Light** (Flatly) and **Dark** (Darkly) themes via the Options menu. |
14 | | -- 🖱️ **Advanced Mouse Control**: Perform clicks and movements at specific screen coordinates (`moveto(x,y)`, `click(x,y)`, etc.). |
15 | | -- 🎯 **Coordinate/Color Capture**: Built-in tool to capture mouse coordinates (X,Y) and screen pixel color (R,G,B) with a single click. |
16 | | -- 🎨 **Color Detection**: Pause script execution until a specific color appears at designated coordinates (`waitcolor`). |
17 | | - - Includes **robust error handling**: Pauses automation and shows a clear error message if the color isn't found within the timeout, preventing infinite loops. |
18 | | -- ⌨️ **Reliable Typing**: Type strings accurately, preserving case and handling symbols (`Hello World!`, `user@example.com`, etc.). |
19 | | -- 💾 **Save/Load Configurations**: Save your sequences and run settings (repetition mode/count) to JSON files and load them back anytime via the File menu. |
20 | | -- 🛡️ **Safety Features**: |
21 | | - - **Safe Mode** (toggleable via Options menu) prevents potentially disruptive keys/commands. |
22 | | - - **Emergency Stop** (ESC key) immediately halts execution. |
23 | | -- 💡 **Visual Feedback**: |
24 | | - - The currently executing row is highlighted. |
25 | | - - Row status indicators show progress (► running, ✓ completed). |
26 | | - - Status bar displays overall state (Stopped, Running, Loop Count, Completed, Emergency Stop). |
27 | | -- ⚙️ **UI Organization**: |
28 | | - - Clean interface with primary controls (Start/Stop) readily available. |
29 | | - - File operations, Options (Safe Mode, Theme), and Help are neatly organized in a **top menu bar**. |
30 | | - - Action rows feature intuitive controls for **moving up/down**, **duplicating**, and **removing**. |
31 | | -- ⌨️ **Global Hotkeys**: Start (`Ctrl+F2`), Stop (`Ctrl+F3`), and Emergency Stop (`ESC`) from anywhere (requires admin/root privileges on some systems). |
32 | | -- ℹ️ **Info Panel**: Detailed, formatted help window explaining all possible keys and commands (accessible from the Help menu). |
33 | | - |
34 | | - |
35 | | -## Download |
| 7 | +## ✨ Features |
36 | 8 |
|
37 | | -**[Download the latest Windows EXE here](https://github.com/timoinglin/SimpleKeyClicker/releases/latest)** |
| 9 | +- 🎮 **Action Sequencing**: Create and run sequences of keyboard presses and mouse actions |
| 10 | +- ⏱️ **Customizable Timing**: Set delays after each action and hold durations for keys/buttons |
| 11 | +- 🔄 **Repetition Control**: Run sequences indefinitely or for a specific number of times |
| 12 | +- 🌙 **Modern Dark UI**: Beautiful glassmorphism dark theme with purple accents |
| 13 | +- 🖱️ **Advanced Mouse Control**: Click and move at specific coordinates (`moveto(x,y)`, `click(x,y)`) |
| 14 | +- 🎯 **Coordinate/Color Capture**: Built-in tool to capture mouse position and pixel color |
| 15 | +- 🎨 **Color Detection**: Wait for specific colors at designated coordinates (`waitcolor`) |
| 16 | +- ⌨️ **Reliable Typing**: Type strings accurately with proper case handling |
| 17 | +- 💾 **Save/Load Configurations**: Export and import your automation sequences as JSON |
| 18 | +- 🛡️ **Safety Features**: Safe Mode blocks dangerous keys, ESC for emergency stop |
| 19 | +- 💡 **Visual Feedback**: Active row highlighting and status indicators during execution |
| 20 | +- ⌨️ **Global Hotkeys**: Ctrl+F2 (Start), Ctrl+F3 (Stop), ESC (Emergency Stop) |
38 | 21 |
|
| 22 | +## 📥 Download |
39 | 23 |
|
40 | | -## Installation |
41 | | - |
42 | | -1. **Prerequisites**: Ensure you have Python 3.7+ installed. |
43 | | -2. **Clone the repository** (Optional, if you have the code directly, skip this): |
44 | | - ```bash |
45 | | - git clone https://github.com/yourusername/SimpleKeyClicker.git |
46 | | - cd SimpleKeyClicker |
47 | | - ``` |
48 | | -3. **Install dependencies**: |
49 | | - It's recommended to use a virtual environment: |
50 | | - ```bash |
51 | | - python -m venv venv |
52 | | - # On Windows: |
53 | | - venv\Scripts\activate |
54 | | - # On macOS/Linux: |
55 | | - # source venv/bin/activate |
56 | | - ``` |
57 | | - Install the required packages: |
58 | | - ```bash |
59 | | - pip install -r requirements.txt |
60 | | - ``` |
61 | | -
|
62 | | -## Quick Start |
63 | | -
|
64 | | -1. Run the application: |
65 | | - ```bash |
66 | | - python main.py |
67 | | - ``` |
68 | | -2. Click "**Add Row**" to create steps for your sequence. |
69 | | -3. For each row: |
70 | | - * Enter a **Key/Button** or command (see Help > Show Keys/Actions Info). |
71 | | - * Use "**Capture**" to easily get coordinates/colors for commands like `moveto`, `click(x,y)`, `waitcolor`. |
72 | | - * Set the **Hold Time** (how long a key/button is held down, 0.0 for a simple press/click). |
73 | | - * Set the **Delay** (pause *after* the action completes). |
74 | | -4. Use the **▲**, **▼**, **❏**, **X** buttons on each row to organize your sequence. |
75 | | -5. Select the desired **Run Mode**: "Run Indefinitely" or "Run X Times" (enter the number of repetitions). |
76 | | -6. **(Optional)** Go to **File > Save Configuration** to store your setup. |
77 | | -7. Click "**Start**" or press `Ctrl+F2` to begin automation. |
78 | | -8. Click "**Stop**" or press `Ctrl+F3` (or `ESC`) to halt automation. |
79 | | -
|
80 | | -## Available Actions (Key/Button Field) |
81 | | -
|
82 | | -*(Refer to **Help > Show Keys/Actions Info** in the app for detailed, formatted explanations)* |
83 | | -
|
84 | | -**Basic Keyboard Input:** |
85 | | -* Single letters (`a`, `b`), digits (`1`, `2`), symbols (`!`, `@`, `,`). Handled by `pyautogui.write` for reliability. |
86 | | -* Special keys: `tab`, `space`, `enter`, `esc`, `backspace`, `delete`, `up`, `down`, `left`, `right`, `home`, `end`, `pageup`, `pagedown`, `f1`...`f12`, etc. Handled by `pydirectinput.press`. |
87 | | -* Modifier Keys (use `Hold Time > 0`): `shift`, `ctrl`, `alt`, `win` (Windows key). Handled by `pydirectinput.keyDown`/`keyUp`. |
88 | | -* Any unrecognized text is typed out using `pyautogui.write` (e.g., `Hello World!`). |
89 | | -
|
90 | | -**Basic Mouse Input (Current Cursor Position):** |
91 | | -* `click` (Left click) |
92 | | -* `rclick` (Right click) |
93 | | -* `mclick` (Middle click) |
94 | | - *(Use `Hold Time > 0` to hold the click)* |
95 | | -
|
96 | | -**Advanced Mouse Input (Specific Coordinates):** |
97 | | -* `moveto(x,y)`: Moves the mouse cursor to screen coordinates (X, Y). |
98 | | -* `click(x,y)`: Moves to (X, Y) and performs a left click. |
99 | | -* `rclick(x,y)`: Moves to (X, Y) and performs a right click. |
100 | | -* `mclick(x,y)`: Moves to (X, Y) and performs a middle click. |
101 | | - *(Use `Hold Time > 0` with these to hold the click at the specified position)* |
102 | | -
|
103 | | -**Color Detection:** |
104 | | -* `waitcolor(r,g,b,x,y)`: Pauses execution until the color (R, G, B) is detected at screen coordinates (X, Y). |
105 | | - * **Behavior**: If the color is not found within the timeout (~30 seconds), a **modal error dialog** appears, pausing the script. Automation **stops** after you click "OK" on the dialog. |
106 | | -
|
107 | | -## Safety Features |
108 | | -
|
109 | | -### Safe Mode |
110 | | -* Enabled by default (toggle via **Options > Safe Mode** in the menu). |
111 | | -* Blocks potentially disruptive keys (`alt`, `ctrl`, `shift`, `win`, `f4`, `delete`, `tab`) and commands (`waitcolor`). |
112 | | -* Provides an extra layer of safety, especially when testing new sequences. |
| 24 | +**[Download the latest Windows EXE here](https://github.com/timoinglin/SimpleKeyClicker/releases/latest)** |
| 25 | + |
| 26 | +Or build from source (see below). |
| 27 | + |
| 28 | +## 🚀 Installation |
| 29 | + |
| 30 | +### Prerequisites |
| 31 | +- Python 3.8+ |
| 32 | + |
| 33 | +### Setup |
| 34 | + |
| 35 | +1. **Clone the repository**: |
| 36 | + ```bash |
| 37 | + git clone https://github.com/timoinglin/SimpleKeyClicker.git |
| 38 | + cd SimpleKeyClicker |
| 39 | + ``` |
| 40 | + |
| 41 | +2. **Create and activate virtual environment**: |
| 42 | + ```bash |
| 43 | + python -m venv .venv |
| 44 | + # Windows: |
| 45 | + .venv\Scripts\activate |
| 46 | + # macOS/Linux: |
| 47 | + # source .venv/bin/activate |
| 48 | + ``` |
| 49 | + |
| 50 | +3. **Install dependencies**: |
| 51 | + ```bash |
| 52 | + pip install -r requirements.txt |
| 53 | + ``` |
| 54 | + |
| 55 | +4. **Run the application**: |
| 56 | + ```bash |
| 57 | + python main.py |
| 58 | + ``` |
| 59 | + |
| 60 | +## 🔨 Building the EXE |
| 61 | + |
| 62 | +To create a standalone executable: |
| 63 | + |
| 64 | +```bash |
| 65 | +pip install pyinstaller |
| 66 | +pyinstaller --onefile --windowed --icon=logo.ico --add-data "logo.ico;." --add-data "logo.png;." --name "SimpleKeyClicker" main.py |
| 67 | +``` |
| 68 | + |
| 69 | +The EXE will be created in the `dist/` folder. |
| 70 | + |
| 71 | +## 📖 Quick Start |
| 72 | + |
| 73 | +1. Click **"+ Add Action"** to create steps for your sequence |
| 74 | +2. For each row: |
| 75 | + - Enter a **Key/Button** or command (see Available Actions below) |
| 76 | + - Use the **🎯** button to capture coordinates/colors |
| 77 | + - Set **Hold Time** (how long to hold the key/button) |
| 78 | + - Set **Delay** (pause after the action) |
| 79 | +3. Use **▲ ▼ ❏ ✕** buttons to organize rows |
| 80 | +4. Select run mode: **Indefinitely** or **X Times** |
| 81 | +5. Click **▶ START** or press `Ctrl+F2` |
| 82 | +6. Click **⏹ STOP** or press `Ctrl+F3` / `ESC` to halt |
| 83 | + |
| 84 | +## ⌨️ Available Actions |
| 85 | + |
| 86 | +### Keyboard |
| 87 | +| Action | Description | |
| 88 | +|--------|-------------| |
| 89 | +| `a`, `b`, `1`, `2` | Single key press | |
| 90 | +| `space`, `enter`, `tab`, `esc` | Special keys | |
| 91 | +| `up`, `down`, `left`, `right` | Arrow keys | |
| 92 | +| `f1` - `f12` | Function keys | |
| 93 | +| `shift`, `ctrl`, `alt`, `win` | Modifier keys (use Hold Time) | |
| 94 | +| `Hello World!` | Type text string | |
| 95 | + |
| 96 | +### Mouse |
| 97 | +| Action | Description | |
| 98 | +|--------|-------------| |
| 99 | +| `click` | Left click at current position | |
| 100 | +| `rclick` | Right click at current position | |
| 101 | +| `mclick` | Middle click at current position | |
| 102 | +| `click(x,y)` | Left click at coordinates | |
| 103 | +| `rclick(x,y)` | Right click at coordinates | |
| 104 | +| `moveto(x,y)` | Move cursor to coordinates | |
| 105 | + |
| 106 | +### Color Detection |
| 107 | +| Action | Description | |
| 108 | +|--------|-------------| |
| 109 | +| `waitcolor(r,g,b,x,y)` | Wait until color RGB appears at (x,y) | |
| 110 | + |
| 111 | +## 🛡️ Safety Features |
| 112 | + |
| 113 | +### Safe Mode (On by default) |
| 114 | +- Blocks potentially dangerous keys: `alt`, `ctrl`, `shift`, `win`, `f4`, `delete`, `tab` |
| 115 | +- Toggle via the switch in the control panel |
113 | 116 |
|
114 | 117 | ### Emergency Stop |
115 | | -* Pressing the `ESC` key at any time will immediately halt the automation sequence. |
116 | | -* The application status will update, and a confirmation dialog will appear. |
| 118 | +- Press `ESC` at any time to immediately halt automation |
117 | 119 |
|
118 | 120 | ### Global Hotkeys |
119 | | -* `Ctrl+F2`: Start the automation sequence. |
120 | | -* `Ctrl+F3`: Stop the automation sequence gracefully. |
121 | | -* `ESC`: Emergency stop (immediate halt). |
122 | | - *(Note: May require administrator/root privileges to register)* |
123 | | -
|
124 | | -## Tips and Best Practices |
125 | | -
|
126 | | -1. **Test Thoroughly**: Always test new or complex sequences, preferably with **Safe Mode** enabled initially. |
127 | | -2. **Use 'Capture'**: The `Capture` button is the easiest way to get accurate coordinates and colors for commands. |
128 | | -3. **Understand `waitcolor`**: Be aware that it will *stop* the script if the color isn't found within the timeout. Ensure the target color/coordinates are correct. |
129 | | -4. **Appropriate Delays**: Add sufficient `Delay` between actions, especially those that rely on UI changes or animations to complete. |
130 | | -5. **Save Often**: Use **File > Save Configuration** to back up your automation configurations. |
131 | | -6. **Start Simple**: Build complex sequences incrementally. |
132 | | - |
133 | | -## Requirements |
134 | | - |
135 | | -* Python 3.7+ |
136 | | -* ttkbootstrap>=1.10.1 |
137 | | -* keyboard>=0.13.5 |
138 | | -* PyDirectInput>=1.0.4 |
139 | | -* pyautogui>=0.9.54 |
140 | | -* Pillow>=10.0.0 |
141 | | -* pynput>=1.7.6 |
142 | | - |
143 | | -## Contributing |
| 121 | +| Hotkey | Action | |
| 122 | +|--------|--------| |
| 123 | +| `Ctrl+F2` | Start automation | |
| 124 | +| `Ctrl+F3` | Stop automation | |
| 125 | +| `ESC` | Emergency stop | |
144 | 126 |
|
145 | | -Contributions are welcome! Feel free to submit issues, fork the repository, and create pull requests for improvements or bug fixes. |
| 127 | +## 📦 Requirements |
146 | 128 |
|
147 | | -## License |
| 129 | +- Python 3.8+ |
| 130 | +- customtkinter>=5.2.0 |
| 131 | +- keyboard>=0.13.5 |
| 132 | +- PyDirectInput>=1.0.4 |
| 133 | +- pyautogui>=0.9.54 |
| 134 | +- Pillow>=10.0.0 |
| 135 | +- pynput>=1.8.1 |
148 | 136 |
|
149 | | -MIT License |
| 137 | +## 🤝 Contributing |
150 | 138 |
|
151 | | -Copyright (c) 2025 Timo Inglin |
| 139 | +Contributions are welcome! Feel free to submit issues and pull requests. |
152 | 140 |
|
153 | | -Permission is hereby granted, free of charge, to any person obtaining a copy |
154 | | -of this software and associated documentation files (the "Software"), to deal |
155 | | -in the Software without restriction, including without limitation the rights |
156 | | -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
157 | | -copies of the Software, and to permit persons to whom the Software is |
158 | | -furnished to do so, subject to the following conditions: |
| 141 | +## 📄 License |
159 | 142 |
|
160 | | -The above copyright notice and this permission notice shall be included in all |
161 | | -copies or substantial portions of the Software. |
| 143 | +MIT License - Copyright (c) 2025 Timo Inglin |
162 | 144 |
|
163 | | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
164 | | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
165 | | -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
166 | | -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
167 | | -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
168 | | -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
169 | | -SOFTWARE. |
| 145 | +See [LICENSE](LICENSE) for details. |
170 | 146 |
|
171 | | -## Acknowledgments |
| 147 | +## 🙏 Acknowledgments |
172 | 148 |
|
173 | | -- UI built with the modern **ttkbootstrap** library. |
174 | | -- Input simulation primarily powered by **PyDirectInput** and **PyAutoGUI**. |
175 | | -- Screen interaction and color detection via **PyAutoGUI** and **Pillow (PIL)**. |
176 | | -- Global hotkeys managed by **keyboard**. |
177 | | -- Mouse coordinate/color capture uses **pynput**. |
| 149 | +- Modern UI built with **CustomTkinter** |
| 150 | +- Input simulation by **PyDirectInput** and **PyAutoGUI** |
| 151 | +- Screen capture via **Pillow (PIL)** |
| 152 | +- Global hotkeys by **keyboard** |
| 153 | +- Mouse capture by **pynput** |
0 commit comments