fix: The shortcut for displaying the keyboard shortcut help dialog has been changed to Ctrl + /

This commit is contained in:
Aman Harwara 2024-01-28 22:32:32 +05:30
parent 865ebe58d3
commit 5a49005e79
No known key found for this signature in database
GPG key ID: FCE19AA227F56E46
4 changed files with 8 additions and 3 deletions

View file

@ -194,6 +194,10 @@ export class KeyboardService {
const helpItem = this.getKeyboardShortcutHelpItemForHandler(observer)
if (helpItem) {
const existingItem = Array.from(this.keyboardShortcutHelpItems).find((item) => item.command === helpItem.command)
if (existingItem) {
this.keyboardShortcutHelpItems.delete(existingItem)
}
this.keyboardShortcutHelpItems.add(helpItem)
}

View file

@ -22,6 +22,7 @@ export type PlatformedKeyboardShortcut = KeyboardShortcut & {
export type KeyboardShortcutCategory = 'General' | 'Notes list' | 'Current note' | 'Super notes' | 'Formatting'
export type KeyboardShortcutHelpItem = Omit<PlatformedKeyboardShortcut, 'command'> & {
command?: KeyboardCommand
category: KeyboardShortcutCategory
description: string
}

View file

@ -195,9 +195,8 @@ export function getKeyboardShortcuts(platform: Platform, _environment: Environme
},
{
command: TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
key: '?',
preventDefault: true,
modifiers: [KeyboardModifier.Shift],
key: '/',
modifiers: [primaryModifier],
},
]
}

View file

@ -48,6 +48,7 @@ const KeyboardShortcutsModal = ({ keyboardService }: { keyboardService: Keyboard
useEffect(() => {
return keyboardService.addCommandHandler({
command: TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
category: 'General',
description: 'Toggle keyboard shortcuts help',
onKeyDown: () => {
setItems(createGroupedItems(keyboardService.getRegisteredKeyboardShorcutHelpItems()))