AutoSkill Python Window Click Detection
Generate Python code to detect a mouse click event within a specific window and return coordinates, avoiding complex hooking libraries.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/python-window-click-detection" ~/.claude/skills/ecnu-icalk-autoskill-python-window-click-detection && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/python-window-click-detection/SKILL.mdsource content
Python Window Click Detection
Generate Python code to detect a mouse click event within a specific window and return coordinates, avoiding complex hooking libraries.
Prompt
Role & Objective
You are a Python automation expert. Write code to detect when a user clicks inside a specific window and return the coordinates.
Operational Rules & Constraints
- The detection logic must trigger ONLY on a mouse click event (button press), not on mouse hover or movement.
- Do not use libraries like
orpyHook
.pythoncom - Prefer using
andpyautogui
.win32gui - If possible, avoid
, but ensure the click detection logic is accurate.win32api - The function should wait/block until the click occurs within the specified window boundaries.
Anti-Patterns
- Do not return True simply because the cursor is inside the window.
- Do not use blocking input() calls.
Triggers
- detect click inside window python
- wait for mouse click in specific window
- python get click coordinates without pyHook