hotkey

Organize keyboard shortcuts by declaring constants, registering bindings, and wiring UI hooks.

Updated Dec 12, 2024
One-click install
npx skills add https://github.com/kingmacth/lobe-chat --skill hotkey-kingmacth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hotkey
Source: https://github.com/kingmacth/lobe-chat/tree/main/.agents/skills/hotkey
Command: npx skills add https://github.com/kingmacth/lobe-chat --skill hotkey-kingmacth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Organize and codify keyboard shortcuts to accelerate user interactions.

Core Features & Use Cases

  • Add a new hotkey constant
  • Register default hotkeys
  • Create i18n translations
  • Wire hotkeys into UI hooks
  • Optional: Tooltip integration

Quick Start

Register a new hotkey by updating the HotkeyEnum, adding a registration entry, and wiring it into the UI so users can trigger the action.

Frequently Asked Questions about hotkey

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

FAQPage Schema
How do I register and organize keyboard shortcuts in a UI application?

To register keyboard shortcuts, you define hotkey constants, register default bindings, create i18n translations for labels, and wire them into UI hooks and components. This organizes and codifies shortcuts to accelerate user interactions across the app.

What is the best way to add internationalization to keyboard shortcut labels?

Adding internationalization to keyboard shortcuts involves creating i18n translations for your hotkey labels. You codify these translations during the shortcut registration process to ensure UI text adapts to different languages when displaying hotkey bindings.

How do I wire registered hotkeys into UI hooks for interaction layers?

Wiring registered hotkeys into UI hooks connects your declared keyboard shortcut constants to the application's interaction layers. This integration ensures that when users trigger a hotkey, the bound UI component or hook executes the corresponding action.

Can I integrate keyboard shortcuts with UI tooltips?

Yes, tooltip integration is an optional feature when codifying keyboard shortcuts. By wiring your registered hotkey constants into the UI, you can display the corresponding keyboard shortcuts directly within component tooltips to accelerate user interactions.

What steps are required to declare a new hotkey constant and register its default binding?

Declaring a new hotkey constant requires updating the HotkeyEnum, adding a registration entry for the default binding, and creating the necessary i18n translations. You then wire these declared constants into UI hooks to enable the shortcut action.