Skip to content

Commit 478f49d

Browse files
committed
fix: #2719 Shortcuts Ctrl + Shift + 1 and Ctrl + Shift + 2 aren't working.
1 parent a3cf391 commit 478f49d

File tree

2 files changed

+262
-206
lines changed

2 files changed

+262
-206
lines changed

client/common/useKeyDownHandlers.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,16 @@ export default function useKeyDownHandlers(keyHandlers) {
3232
if (!e.key) return;
3333
const isMac = navigator.userAgent.toLowerCase().indexOf('mac') !== -1;
3434
const isCtrl = isMac ? e.metaKey : e.ctrlKey;
35+
const shiftNumKeyMap = {
36+
'!': '1',
37+
'@': '2'
38+
};
3539
if (e.shiftKey && isCtrl) {
36-
handlers.current[`ctrl-shift-${e.key.toLowerCase()}`]?.(e);
40+
handlers.current[
41+
`ctrl-shift-${
42+
shiftNumKeyMap[e.key.toLowerCase()] || e.key.toLowerCase()
43+
}`
44+
]?.(e);
3745
} else if (isCtrl) {
3846
handlers.current[`ctrl-${e.key.toLowerCase()}`]?.(e);
3947
}

0 commit comments

Comments
 (0)