feat(SubmitKey): add MetaEnter option

Add another option for MacOS user who prefer Cmd+Enter
or Linux user who prefer Meta+Enter.
This commit is contained in:
xiaotianxt 2023-03-28 00:22:33 +08:00 committed by xiaotianxt
parent 8f498075b9
commit d822f333c2
2 changed files with 2 additions and 0 deletions

View File

@ -131,6 +131,7 @@ function useSubmitHandler() {
(config.submitKey === SubmitKey.AltEnter && e.altKey) ||
(config.submitKey === SubmitKey.CtrlEnter && e.ctrlKey) ||
(config.submitKey === SubmitKey.ShiftEnter && e.shiftKey) ||
(config.submitKey === SubmitKey.MetaEnter && e.metaKey) ||
(config.submitKey === SubmitKey.Enter &&
!e.altKey &&
!e.ctrlKey &&

View File

@ -21,6 +21,7 @@ export enum SubmitKey {
CtrlEnter = "Ctrl + Enter",
ShiftEnter = "Shift + Enter",
AltEnter = "Alt + Enter",
MetaEnter = "Meta + Enter",
}
export enum Theme {