Add hotkey-driven autoclicker#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52d3a49015
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| parser = argparse.ArgumentParser(description="Hotkey-controlled autoclicker.") | ||
| parser.add_argument("--interval", type=float, default=0.2, help="Seconds between clicks.") | ||
| parser.add_argument("--jitter", type=float, default=0.0, help="Random +/- jitter in seconds.") | ||
| parser.add_argument("--button", type=parse_button, default="left", help="left/right/middle") |
There was a problem hiding this comment.
Parse default --button to a mouse.Button
When --button is omitted, argparse does not apply type=parse_button to the default, so args.button becomes the raw string "left". That string is passed into mouse.Controller.click, which expects a mouse.Button enum and will raise at runtime (or behave unexpectedly) when the default path is used. This only occurs for the default case, so users who don’t specify --button will hit it immediately.
Useful? React with 👍 / 👎.
Motivation
Description
src/autoclicker.pyimplementingClickConfigandAutoClickerusingpynputto control the mouse and listen for hotkeys, with CLI flags for--interval,--jitter,--button,--duration,--toggle-hotkey, and--stop-hotkey.README.mddocumenting installation, usage examples, and the default hotkeys (Ctrl+Alt+Tto toggle andCtrl+Alt+Sto stop).requirements.txtwithpynput>=1.7.7declared.Testing
Codex Task