From d822f333c2e7291b21217e7fa3933adbd773aa47 Mon Sep 17 00:00:00 2001 From: xiaotianxt Date: Tue, 28 Mar 2023 00:22:33 +0800 Subject: [PATCH] feat(SubmitKey): add MetaEnter option Add another option for MacOS user who prefer Cmd+Enter or Linux user who prefer Meta+Enter. --- app/components/home.tsx | 1 + app/store/app.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/app/components/home.tsx b/app/components/home.tsx index 8396438a..9c7e45f1 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -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 && diff --git a/app/store/app.ts b/app/store/app.ts index 703078ad..d7ff2ff7 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -21,6 +21,7 @@ export enum SubmitKey { CtrlEnter = "Ctrl + Enter", ShiftEnter = "Shift + Enter", AltEnter = "Alt + Enter", + MetaEnter = "Meta + Enter", } export enum Theme {