makepad-event-action

Implements Makepad event handling and widget-to-parent action emission via cx.action and capture_actions.

745|87|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/ZhangHanDong/makepad-skills --skill makepad-event-action-zhanghandong
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: makepad-event-action
Source: https://github.com/ZhangHanDong/makepad-skills/tree/main/skills/makepad-event-action
Command: npx skills add https://github.com/ZhangHanDong/makepad-skills --skill makepad-event-action-zhanghandong

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides a structured approach to handling a wide range of Makepad events (mouse, keyboard, touch, lifecycle) and emitting typed actions from widgets to their parents, enabling clean, scalable UI logic.

Core Features & Use Cases

  • Handles lifecycle, input, and drawing events and maps them to defined actions.
  • Demonstrates event propagation rules (downward events, upward actions) and how to capture and forward actions between widgets.
  • Provides practical patterns for using the Event, Hit, ActionsBuf, and ActionTrait APIs in real-world widgets.

Quick Start

Instantiate a widget, implement handle_event to respond to Hit::FingerDown or KeyDown, and emit actions using cx.action to notify parents.

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 Makepad widget events and send actions to a parent component?

To handle Makepad widget events and send actions, implement handle_event to process inputs like Hit::FingerDown, then use cx.action to emit typed actions upward to parent components.

How does event and action propagation work in the Makepad UI framework?

Makepad event propagation flows downward for events like MouseDown and KeyDown, while actions flow upward, allowing parent widgets to capture and forward actions using capture_actions and ActionsBuf.

Can I use Makepad event handling patterns for both desktop and mobile UIs?

Yes, Makepad event handling patterns apply across desktop and mobile UIs, enabling consistent action emission and handling for MouseDown, KeyDown, and TouchUpdate events across different platforms.

What is the best way to capture actions from child widgets in Makepad?

The best way to capture actions from child widgets in Makepad is using capture_actions to intercept ActionsBuf, ensuring typed actions emitted via cx.action are properly caught and processed by parents.

How do I map Makepad lifecycle and drawing events to defined widget actions?

To map Makepad lifecycle and drawing events to defined actions, implement handle_event in your widget to process Event enums and Hit matching, then emit corresponding actions using the ActionTrait API.

Why are my Makepad widget actions not reaching the parent component?

Makepad widget actions might not reach parent components if they are not emitted using cx.action or if parents fail to intercept the ActionsBuf flow using capture_actions during event handling.