From acaaa1292f80452adf1a183faf98dcf71d6d557e Mon Sep 17 00:00:00 2001 From: Ian Sanders Date: Tue, 5 Dec 2023 16:13:06 +0000 Subject: [PATCH 1/2] Don't use symbol plane unless `Alt` is pressed --- src/hotkey.ts | 2 +- src/macos-symbol-layer.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hotkey.ts b/src/hotkey.ts index ec0ed73..ed0efac 100644 --- a/src/hotkey.ts +++ b/src/hotkey.ts @@ -47,7 +47,7 @@ export function eventToHotkeyString( } if (!modifierKeyNames.includes(key)) { - const nonOptionPlaneKey = matchApplePlatform.test(platform) ? macosSymbolLayerKeys[key] ?? key : key + const nonOptionPlaneKey = hotkeyString.includes('Alt') && matchApplePlatform.test(platform) ? macosSymbolLayerKeys[key] ?? key : key const syntheticKey = syntheticKeyNames[nonOptionPlaneKey] ?? nonOptionPlaneKey hotkeyString.push(syntheticKey) } diff --git a/src/macos-symbol-layer.ts b/src/macos-symbol-layer.ts index 740c9bd..a2fd5e3 100644 --- a/src/macos-symbol-layer.ts +++ b/src/macos-symbol-layer.ts @@ -16,7 +16,6 @@ export const macosSymbolLayerKeys: Record = { ['º']: '0', ['–']: '-', ['≠']: '=', - ['`']: '`', ['⁄']: '!', ['€']: '@', ['‹']: '#', From fba17fb00b590cca0210db7ea45c65bc40c640be Mon Sep 17 00:00:00 2001 From: Ian Sanders Date: Tue, 5 Dec 2023 16:17:06 +0000 Subject: [PATCH 2/2] Format --- src/hotkey.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotkey.ts b/src/hotkey.ts index ed0efac..cb35c23 100644 --- a/src/hotkey.ts +++ b/src/hotkey.ts @@ -47,7 +47,8 @@ export function eventToHotkeyString( } if (!modifierKeyNames.includes(key)) { - const nonOptionPlaneKey = hotkeyString.includes('Alt') && matchApplePlatform.test(platform) ? macosSymbolLayerKeys[key] ?? key : key + const nonOptionPlaneKey = + hotkeyString.includes('Alt') && matchApplePlatform.test(platform) ? macosSymbolLayerKeys[key] ?? key : key const syntheticKey = syntheticKeyNames[nonOptionPlaneKey] ?? nonOptionPlaneKey hotkeyString.push(syntheticKey) }