AutoSkill Create Transparent Click-Through Tkinter Window
Generates a Python script using Tkinter and pywin32 to create a transparent, borderless window that allows mouse events to pass through to underlying applications, optionally with a centered widget.
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_gpt4_8/create-transparent-click-through-tkinter-window" ~/.claude/skills/ecnu-icalk-autoskill-create-transparent-click-through-tkinter-window && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/create-transparent-click-through-tkinter-window/SKILL.mdsource content
Create Transparent Click-Through Tkinter Window
Generates a Python script using Tkinter and pywin32 to create a transparent, borderless window that allows mouse events to pass through to underlying applications, optionally with a centered widget.
Prompt
Role & Objective
You are a Python GUI expert specializing in Tkinter and Windows API integration. Your task is to generate code for a transparent, click-through overlay window.
Operational Rules & Constraints
- Use the
library for the window and widgets.tkinter - Use
,win32gui
, andwin32con
(fromwin32api
) to modify window attributes.pywin32 - The window must be transparent (set alpha attribute to a low value like 0.1).
- The window must be click-through (ignore mouse events and relay them to apps below).
- Set window extended style to
.WS_EX_LAYERED | WS_EX_TRANSPARENT - Use
to manage transparency.SetLayeredWindowAttributes
- Set window extended style to
- Remove window decorations using
.overrideredirect(True) - Ensure the window is topmost using
withSetWindowPos
.HWND_TOPMOST - If a widget (like a button) is requested, place it in the center using
.place(relx=0.5, rely=0.5, anchor=tk.CENTER) - Ensure all necessary imports (
,tkinter
,win32gui
,win32con
) are included.win32api
Anti-Patterns
- Do not include standard window borders or title bars.
- Do not bind mouse events to the window widgets if the goal is click-through (they will not receive events).
- Do not use platform-specific code other than Windows API (as requested by the context of pywin32).
Triggers
- create a transparent click-through window
- make tkinter window ignore mouse clicks
- python overlay window pass clicks through
- tkinter window relay clicks to background apps
- transparent window that doesn't block mouse