makepad-2.0-events: a skill for Makepad 2.0 events
The makepad-2.0-events skill gives your agent a map of event and action handling in Makepad 2.0, from Splash on_click to the Rust MatchEvent trait.
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a claude-codeWhat makepad-2.0-events does
Makepad 2.0 splits event handling across two layers. Inside script_mod! Splash code, handlers sit next to the widgets: on_click, on_render, on_return, on_startup. That covers plain interactivity — a button press, typed text, a redrawn list. The Rust side is the MatchEvent trait, with methods such as handle_actions, handle_timer and handle_http_response. Business logic, network calls and anything needing full Rust belong there.
Two macros connect the layers. script_eval!(cx, { ... }) runs Splash code from Rust, so you can update state and kick off a render. script_apply_eval!(cx, widget_ref, { ... }) patches widget properties at runtime. The skill covers both and says when each fits.
Splash handlers use closure syntax: || for no arguments, |checked| when a value comes in. CheckBox passes its new state, TextInput catches Enter through on_return. on_render does not fire on its own — you call ui.widget_name.render(), and new_batch: true on a view clears the previous draw content first. That last part trips people up.
The Rust section groups the trait methods: lifecycle (handle_startup, handle_shutdown, handle_pause, handle_resume), window focus, frames, widget actions, keys, timers, drawing, HTTP responses and progress, signals, audio devices, MIDI ports, video inputs. By default handle_actions walks every action and calls handle_action for each one.
What it helps with
- Wire a button press to a state change in Splash code
- Redraw a list after an item is added or removed
- Catch Enter in a TextInput and submit the form
- Keep the split clean: Splash for UI, Rust for network and timers
- Call Splash from Rust with
script_eval!and patch widget properties
Example prompts for the agent
- Add an
on_clickhandler to the add button and clear the input field afterwards - Make the list re-render after an item is deleted, using
on_render - Handle the HTTP response in Rust with
handle_http_responseand refresh the UI
How to install makepad-2.0-events
1Skills CLI (Vercel)
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a claude-code2Manually: put the files in place
~/.claude/skills/makepad-2.0-events/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/makepad-2.0-events/
1Skills CLI (Vercel)
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a codex2Manually: put the files in place
.agents/skills/makepad-2.0-events/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a cursor2Manually: put the files in place
.cursor/skills/makepad-2.0-events/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ZhangHanDong/makepad-skills makepad-2.0-events2Manually: put the files in place
.github/skills/makepad-2.0-events/SKILL.md1Skills CLI (Vercel)
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a gemini-cli2Platform CLI
gemini skills install https://github.com/ZhangHanDong/makepad-skills --path skills/makepad-2.0-eventsManually: put the files in place
.devin/skills/makepad-2.0-events/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about makepad-2.0-events
How do I install makepad-2.0-events in Claude Code?
Run npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a claude-code. The skill file lands at ~/.claude/skills/makepad-2.0-events/SKILL.md.
What does makepad-2.0-events do?
It documents event and action handling in Makepad 2.0: inline Splash handlers and the Rust MatchEvent trait, plus the two bridge macros between them.
How do the two event layers in Makepad 2.0 differ?
The Splash layer keeps handlers next to widgets and suits simple interactivity. The Rust layer, through MatchEvent, takes business logic, network calls and timers.