Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: dead key issue in mac (#3058)

Anwarul Islam9dbdef9286db
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