fix: The shortcut for displaying the keyboard shortcut help dialog has been changed to Ctrl + /
This commit is contained in:
@@ -194,6 +194,10 @@ export class KeyboardService {
|
|||||||
|
|
||||||
const helpItem = this.getKeyboardShortcutHelpItemForHandler(observer)
|
const helpItem = this.getKeyboardShortcutHelpItemForHandler(observer)
|
||||||
if (helpItem) {
|
if (helpItem) {
|
||||||
|
const existingItem = Array.from(this.keyboardShortcutHelpItems).find((item) => item.command === helpItem.command)
|
||||||
|
if (existingItem) {
|
||||||
|
this.keyboardShortcutHelpItems.delete(existingItem)
|
||||||
|
}
|
||||||
this.keyboardShortcutHelpItems.add(helpItem)
|
this.keyboardShortcutHelpItems.add(helpItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export type PlatformedKeyboardShortcut = KeyboardShortcut & {
|
|||||||
export type KeyboardShortcutCategory = 'General' | 'Notes list' | 'Current note' | 'Super notes' | 'Formatting'
|
export type KeyboardShortcutCategory = 'General' | 'Notes list' | 'Current note' | 'Super notes' | 'Formatting'
|
||||||
|
|
||||||
export type KeyboardShortcutHelpItem = Omit<PlatformedKeyboardShortcut, 'command'> & {
|
export type KeyboardShortcutHelpItem = Omit<PlatformedKeyboardShortcut, 'command'> & {
|
||||||
|
command?: KeyboardCommand
|
||||||
category: KeyboardShortcutCategory
|
category: KeyboardShortcutCategory
|
||||||
description: string
|
description: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,9 +195,8 @@ export function getKeyboardShortcuts(platform: Platform, _environment: Environme
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
command: TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
|
command: TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
|
||||||
key: '?',
|
key: '/',
|
||||||
preventDefault: true,
|
modifiers: [primaryModifier],
|
||||||
modifiers: [KeyboardModifier.Shift],
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const KeyboardShortcutsModal = ({ keyboardService }: { keyboardService: Keyboard
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return keyboardService.addCommandHandler({
|
return keyboardService.addCommandHandler({
|
||||||
command: TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
|
command: TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
|
||||||
|
category: 'General',
|
||||||
description: 'Toggle keyboard shortcuts help',
|
description: 'Toggle keyboard shortcuts help',
|
||||||
onKeyDown: () => {
|
onKeyDown: () => {
|
||||||
setItems(createGroupedItems(keyboardService.getRegisteredKeyboardShorcutHelpItems()))
|
setItems(createGroupedItems(keyboardService.getRegisteredKeyboardShorcutHelpItems()))
|
||||||
|
|||||||
Reference in New Issue
Block a user