mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 19:50:09 +00:00
♻️ refactor: refactor hotkey import to avoid db generate error (#7374)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { combineKeys } from '@lobehub/ui/es/Hotkey';
|
||||
|
||||
import {
|
||||
HotkeyEnum,
|
||||
HotkeyGroupEnum,
|
||||
@@ -8,6 +6,8 @@ import {
|
||||
KeyEnum,
|
||||
} from '@/types/hotkey';
|
||||
|
||||
const combineKeys = (keys: string[]) => keys.join('+');
|
||||
|
||||
// mod 在 Mac 上是 command 键,alt 在 Win 上是 ctrl 键
|
||||
export const HOTKEYS_REGISTRATION: HotkeyRegistration = [
|
||||
// basic
|
||||
|
||||
+54
-3
@@ -1,8 +1,59 @@
|
||||
import { KeyMapEnum } from '@lobehub/ui/es/Hotkey';
|
||||
|
||||
export const KeyEnum = {
|
||||
...KeyMapEnum,
|
||||
Alt: 'alt',
|
||||
Backquote: 'backquote',
|
||||
// `
|
||||
Backslash: 'backslash',
|
||||
// \
|
||||
Backspace: 'backspace',
|
||||
BracketLeft: 'bracketleft',
|
||||
// [
|
||||
BracketRight: 'bracketright',
|
||||
// ]
|
||||
Comma: 'comma',
|
||||
// ,
|
||||
Ctrl: 'ctrl',
|
||||
Down: 'down',
|
||||
Enter: 'enter',
|
||||
Equal: 'equal',
|
||||
// =
|
||||
Esc: 'esc',
|
||||
Left: 'left',
|
||||
LeftClick: 'left-click',
|
||||
LeftDoubleClick: 'left-double-click',
|
||||
Meta: 'meta',
|
||||
// Command on Mac, Win on Win
|
||||
MiddleClick: 'middle-click',
|
||||
Minus: 'minus',
|
||||
// -
|
||||
Mod: 'mod',
|
||||
|
||||
Number: '1-9',
|
||||
|
||||
// Command on Mac, Ctrl on Win
|
||||
Period: 'period',
|
||||
|
||||
// .
|
||||
Plus: 'equal',
|
||||
|
||||
// +
|
||||
QuestionMark: 'slash',
|
||||
|
||||
// ?
|
||||
Quote: 'quote',
|
||||
// '
|
||||
Right: 'right',
|
||||
RightClick: 'right-click',
|
||||
RightDoubleClick: 'right-double-click',
|
||||
|
||||
Semicolon: 'semicolon',
|
||||
// ;
|
||||
Shift: 'shift',
|
||||
|
||||
Slash: 'slash',
|
||||
// /
|
||||
Space: 'space',
|
||||
Tab: 'tab',
|
||||
Up: 'up',
|
||||
} as const;
|
||||
|
||||
export const HotkeyEnum = {
|
||||
|
||||
Reference in New Issue
Block a user