其他

hotkey

lobehub/lobehub

Use for keyboard shortcuts, registration, key combinations, scope, conflicts and shortcut tooltips.

  • 4103 次安装
  • 8.4万 星标
  • 收录于

安装命令

npx skills add https://github.com/lobehub/lobehub --skill hotkey

SKILL.md

Adding Keyboard Shortcuts Guide

Steps to Add a New Hotkey

1. Update Hotkey Constant

In packages/types/src/hotkey.ts, add the new id to the HotkeyId union — it's the source of truth HotkeyEnum is typed against:

export type HotkeyId =
  | 'addUserMessage'
  // existing...
  | 'saveTopic';

2. Register Default Hotkey

In packages/const/src/hotkeys.ts, KeyEnum and combineKeys are already defined locally in this file, so no import is needed — add the entry to HotkeyEnum and to HOTKEYS_REGISTRATION: