hotkey
Add or edit LobeHub keyboard shortcuts. Use for HotkeyEnum, HOTKEYS_REGISTRATION, combineKeys, useHotkeyById, tooltip hotkeys, shortcut scope, conflicts, or Cmd/Ctrl key combos.
npx skills add lobehub/lobehub --skill hotkey --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.
# Adding Keyboard Shortcuts Guide ## Steps to Add a New Hotkey ### 1. Update Hotkey Constant In `src/types/hotkey.ts`: ```typescript export const HotkeyEnum = { // existing... ClearChat: 'clearChat', // Add new } as const; ``` ### 2. Register Default Hotkey In `src/const/hotkeys.ts`: ```typescript import { KeyMapEnum as Key, combineKeys } from '@lobehub/ui'; export const HOTKEYS_REGISTRATION: HotkeyRegistration = [ { group: HotkeyGroupEnum.Conversation, id: HotkeyEnum.ClearChat, keys: combineKeys([Key.Mod, Key.Shift, Key.Backspace]), scopes: [HotkeyScopeEnum.Chat], }, ]; ``` ### 3. Add i18n Translation In `packages/locales/src/default/hotkey.ts`: ```typescript const hotkey: HotkeyI18nTranslations = { clearChat: { desc: '清空当前会话的所有消息记录', title: '清空聊天记录', }, }; ``` ### 4. Create and Register Hook In `src/hooks/useHotkeys/chatScope.ts`: ```typescript export const useClearChatHotkey = () => { const clearMessages = useChatStore((s) => s.clearMessages); return useHotkeyById(HotkeyEnum.ClearChat, clearMessages); }; export const useRegisterChatHotkeys = () => { useClearChatHotkey(); // ...other hotkeys }; ``` ### 5. Add Tooltip (Optional) ```tsx const clearChatHotkey = useUserStore(settings
- Steps to Add a New Hotkey
- 1. Update Hotkey Constant
- 2. Register Default Hotkey
- 3. Add i18n Translation
- 4. Create and Register Hook
- 5. Add Tooltip (Optional)
- Best Practices
- Troubleshooting
What does the hotkey skill do?
Add or edit LobeHub keyboard shortcuts. Use for HotkeyEnum, HOTKEYS_REGISTRATION, combineKeys, useHotkeyById, tooltip hotkeys, shortcut scope, conflicts, or Cmd/Ctrl key combos.
How do I install it?
Run `npx skills add lobehub/lobehub --skill hotkey --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 lobehub/lobehub, a repository with 81,252 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.