makepad-2.0-events
makepad event, makepad action, MatchEvent, handle_event, handle_actions, on_click, on_render, on_return, on_startup, script_eval!, script_apply_eval!, button clicked, text changed, slider changed, checkbox toggled, Hit, FingerDown, FingerUp, KeyDown, KeyUp, Focus, ids!, TextCopy, TextCut, SelectionHandleDrag, PopupDismissed, clipboard, selection, IME, ImeAction, popup window events, video inputs, camera events, 事件, 动作, 点击, 输入, 回调, 交互, 事件处理, 剪贴板, 选择, 弹出窗口
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Makes Makepad 2.0's event and action system available to the agent, covering both Splash inline event handlers (on_click, on_render, on_return, on_startup) and Rust-side MatchEvent-based handling (handle_actions, handle_timer, handle_http_response, etc.). It describes how to bridge Splash and Rust via script_eval! and script_apply_eval!, and how to access and manipulate widgets from Rust (button, text_input, slider, etc.).
How it works
- Splashes define inline event handlers in script_mod!, such as on_click and on_render, attached to widgets. These handlers can read and set widget values, trigger re-renders, and call other widget events.
- The Rust layer uses the MatchEvent trait to process business logic and I/O via methods like handle_action, handle_actions, handle_timer, handle_http_response, and more. The Core dispatch requires implementing handle_actions and invoking self.ui.handle_event(cx, event, &mut Scope::empty()) in handle_event to propagate to widgets.
- Communication between Rust and Splash occurs through two macros: script_eval!(cx, { ... }) to execute Splash code from Rust, and script_apply_eval!(cx, widget_ref, { ... }) for targeted runtime property patches.
- Widget access from Rust uses self.ui.widget_type(cx, ids!(name)) and supports various setters and getters for common widgets (Button, TextInput, CheckBox, DropDown, Slider, etc.). Nested IDs and generic access are supported.
When to use it
- Use Splash inline event handlers for UI-level interactions directly in script_mod! when declarative UI logic is preferred (on_click, on_render, on_startup).
- Use Rust MatchEvent for core business logic, I/O, and high-control event handling that require Rust power (handle_actions, handle_http_response, handle_timer, etc.).
- Use script_eval! to update Splash state from Rust and trigger renders; use script_apply_eval! for targeted property patches without running full Splash code.
What it can touch
- Widgets accessed through self.ui: Button, TextInput, CheckBox, DropDown, Slider, RadioButton, LinkLabel, and more.
- It relies on declared tools: claude-code.
- It interacts with Splash via script_eval! and script_apply_eval!, and with the Rust side via the MatchEvent trait implementation.
Caveats
- The review is confined to what the skill explicitly documents: two-layer event system, macros for bridging, and widget access patterns. No speculative outcomes or unstated limitations are provided.
- Implementations require boilerplate like the standard Rust app structure and proper dispatch in handle_event to both MatchEvent and widget UI.
# Makepad 2.0 Event & Action System ## Overview Makepad 2.0 uses a **two-layer event system**: 1. **Splash Layer** -- Inline event handlers written directly in `script_mod!` Splash code (`on_click`, `on_render`, `on_return`, `on_startup`). These handle UI interactions declaratively inside the script, close to the widget definitions. 2. **Rust Layer** -- The `MatchEvent` trait with `handle_actions`, `handle_timer`, `handle_http_response`, etc. These handle business logic, external I/O, and anything that needs full Rust power. Both layers communicate through two bridge macros: - `script_eval!(cx, { ... })` -- Execute Splash code from Rust (update state, trigger renders) - `script_apply_eval!(cx, widget_ref, { ... })` -- Patch widget properties from Rust at runtime --- ## 1. Splash Inline Event Handlers Event handlers are attached directly to widgets inside `script_mod!` blocks. They use closure syntax with `||` for no arguments or `|arg|` for callbacks that receive a value. ### on_click -- Button/widget click Fires when the user clicks a button or clickable widget. No arguments for plain buttons, or `|checked|` for CheckBox which passes the new boolean state. ```splash // Plain butto
- Overview
- 1. Splash Inline Event Handlers
- onclick -- Button/widget click
- onrender -- Dynamic rendering
- onreturn -- TextInput enter key
- onstartup -- App startup
- Event handler capabilities
- 2. Rust Event Handling -- MatchEvent Trait
- Core trait definition (from draw/src/matchevent.rs)
- Standard App boilerplate (required)
- 3. Widget Action API
- Button
- TextInput
- CheckBox
What does the makepad-2.0-events skill do?
makepad event, makepad action, MatchEvent, handle_event, handle_actions, on_click, on_render, on_return, on_startup, script_eval!, script_apply_eval!, button clicked, text changed, slider changed, checkbox toggled, Hit, FingerDown, FingerUp, KeyDown, KeyUp, Focus, ids!, TextCopy, TextCut, SelectionHandleDrag, PopupDismissed, clipboard, selection, IME, ImeAction, popup window events, video inputs, camera events, 事件, 动作, 点击, 输入, 回调, 交互, 事件处理, 剪贴板, 选择, 弹出窗口
How do I install it?
Run `npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-events --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ZhangHanDong/makepad-skills, a repository with 745 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
