makepad-event-action

Standardize Makepad widget event handling and action propagation via cx.action.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/RoooyHe/betula --skill makepad-event-action
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: makepad-event-action
Source: https://github.com/RoooyHe/betula/tree/main/.claude/skills/makepad-event-action
Command: npx skills add https://github.com/RoooyHe/betula --skill makepad-event-action

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill centralizes Makepad event and action handling, enabling widgets to communicate via a clear, consistent flow between child and parent.

Core Features & Use Cases

  • Event handling: Manage lifecycle, mouse, touch, keyboard, and window events within Makepad widgets.
  • Action system: Define actions, emit them from widgets, and capture them in parents to trigger higher-level behavior.
  • Use Case: Build a nested widget tree where a child button emits a Clicked action and a parent updates its state accordingly.

Quick Start

Implement your first widget's handle_event to emit actions with cx.action(...) and use cx.capture_actions to respond to child actions in the parent.

Frequently Asked Questions about makepad-event-action

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle events and emit actions in Makepad widgets?

Makepad event handling uses the handle_event function to process lifecycle, mouse, touch, and keyboard events, then emits actions via cx.action(). Widgets capture child actions using cx.capture_actions to trigger higher-level behavior.

How does action propagation work between parent and child widgets in Makepad?

Action propagation in Makepad flows from child to parent. Child widgets emit actions using cx.action(...), and parent widgets capture them via cx.capture_actions to update state and coordinate behavior across the widget tree.

What is the DefaultNone pattern for Makepad actions?

The DefaultNone pattern provides a default empty action state for Makepad widgets. It satisfies ActionTrait definitions by ensuring actions initialize safely before any user interaction triggers an actual event payload.

Can I use this approach to handle MouseDown, KeyDown, and TouchUpdate events in Makepad?

Yes, Makepad widget event handling standardizes processing for MouseDown, KeyDown, TouchUpdate, and lifecycle events. The system applies ActionTrait definitions to emit and forward these events consistently.

What is the best way to standardize event-to-action communication in Makepad UI components?

Standardizing Makepad event-to-action communication involves defining actions that satisfy ActionTrait, emitting them from child widgets with cx.action, and capturing them in parents. This creates a clear, consistent flow for nested widget trees.

Why are my Makepad widget actions not being captured by the parent component?

Makepad actions fail to capture when parents do not call cx.capture_actions or when child widgets omit cx.action emissions. Ensure both the ActionTrait definition and the capture logic are correctly implemented in the widget tree.