From 9dbdef9286db30d51342156f20a5822b85587960 Mon Sep 17 00:00:00 2001 From: Anwarul Islam Date: Wed, 24 May 2023 02:41:37 +0600 Subject: [PATCH] fix: dead key issue in mac (#3058) --- packages/hoppscotch-common/src/helpers/keybindings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-common/src/helpers/keybindings.ts b/packages/hoppscotch-common/src/helpers/keybindings.ts index 7afd26bed..f2f62f128 100644 --- a/packages/hoppscotch-common/src/helpers/keybindings.ts +++ b/packages/hoppscotch-common/src/helpers/keybindings.ts @@ -121,8 +121,8 @@ function getPressedKey(ev: KeyboardEvent): Key | null { else if (val === "arrowright") return "right" // Check letter keys - if (val.length === 1 && val.toUpperCase() !== val.toLowerCase()) - return val as Key + const isLetter = ev.code.toLowerCase().startsWith("key") + if (isLetter) return ev.code.toLowerCase().substring(3) as Key // Check if number keys if (val.length === 1 && !isNaN(val as any)) return val as Key