# 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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 751
- Author: ZhangHanDong
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ZhangHanDong/makepad-skills/tree/HEAD/skills/makepad-2.0-events/SKILL.md
- Updated: 2026-04-07
- HTML: https://affpapa.org/en/nevibecode/skills/makepad-20-events

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/makepad-2.0-events/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/makepad-2.0-events/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/makepad-2.0-events/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/makepad-2.0-events/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ZhangHanDong/makepad-skills makepad-2.0-events
```

2. **Manually: put the files in place**
- File: `.github/skills/makepad-2.0-events/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ZhangHanDong/makepad-skills --path skills/makepad-2.0-events
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/makepad-2.0-events/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ZhangHanDong/makepad-skills/tree/HEAD/skills/makepad-2.0-events/SKILL.md

## When to use it
- 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
- Add an `on_click` handler 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_response` and refresh the UI

## Similar
- [pixijs-events](https://affpapa.org/en/nevibecode/skills/pixijs-events.md) — skill · 5900 installs
- [pcf-events](https://affpapa.org/en/nevibecode/rules/pcf-events.md) — rule · ★ 40451
- [gws-events](https://affpapa.org/en/nevibecode/skills/gws-events.md) — skill · 31500 installs
- [gws-events-subscribe](https://affpapa.org/en/nevibecode/skills/gws-events-subscribe.md) — skill · 30800 installs
- [inngest-events](https://affpapa.org/en/nevibecode/skills/inngest-events.md) — skill · 3800 installs
- [vtex-io-events-and-workers](https://affpapa.org/en/nevibecode/skills/vtex-io-events-and-workers.md) — skill · 1100 installs

From the same set: [zhanghandong/makepad-skills](https://affpapa.org/en/nevibecode/by/zhanghandong/makepad-skills.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
