From 23ad0680f51aff45fe7eb89e194aa2b7a7e6528b Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 21 Dec 2022 22:39:05 -0600 Subject: [PATCH] Fixed hotkeys not working with shift + number --- src/features/hotkey.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/hotkey.tsx b/src/features/hotkey.tsx index e79b65b..05e878e 100644 --- a/src/features/hotkey.tsx +++ b/src/features/hotkey.tsx @@ -44,6 +44,8 @@ export type GenericHotkey = Replace< } >; +const uppercaseNumbers = [")", "!", "@", "#", "$", "5", "^", "&", "*", "("]; + export function createHotkey( optionsFunc: OptionsFunc ): Hotkey { @@ -79,7 +81,9 @@ document.onkeydown = function (e) { return; } let key = e.key; - if (e.shiftKey) { + if (uppercaseNumbers.includes(key)) { + key = "shift+" + uppercaseNumbers.indexOf(key); + } else if (e.shiftKey) { key = "shift+" + key; } if (e.ctrlKey) {