diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index de568a40f0..fca2a1a153 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -133,6 +133,7 @@ "generalHotkeys": "General Hotkeys", "galleryHotkeys": "Gallery Hotkeys", "unifiedCanvasHotkeys": "Unified Canvas Hotkeys", + "nodesHotkeys": "Nodes Hotkeys", "invoke": { "title": "Invoke", "desc": "Generate an image" @@ -332,6 +333,10 @@ "acceptStagingImage": { "title": "Accept Staging Image", "desc": "Accept Current Staging Area Image" + }, + "addNodes": { + "title": "Add Nodes", + "desc": "Opens the add node menu" } }, "modelManager": { diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx index 67471b7e3d..a5f1539b64 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopLeftPanel/TopLeftPanel.tsx @@ -2,6 +2,7 @@ import { useAppDispatch } from 'app/store/storeHooks'; import IAIButton from 'common/components/IAIButton'; import { addNodePopoverOpened } from 'features/nodes/store/nodesSlice'; import { memo, useCallback } from 'react'; +import { useHotkeys } from 'react-hotkeys-hook'; import { Panel } from 'reactflow'; const TopLeftPanel = () => { @@ -11,6 +12,10 @@ const TopLeftPanel = () => { dispatch(addNodePopoverOpened()); }, [dispatch]); + useHotkeys(['shift+a'], () => { + handleOpenAddNodePopover(); + }); + return ( diff --git a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx index 4da46fdac9..12c25dcb6b 100644 --- a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx +++ b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx @@ -286,6 +286,14 @@ export default function HotkeysModal({ children }: HotkeysModalProps) { }, ]; + const nodesHotkeys = [ + { + title: t('hotkeys.addNodes.title'), + desc: t('hotkeys.addNodes.desc'), + hotkey: 'Shift + A', + }, + ]; + const renderHotkeyModalItems = (hotkeys: HotkeyList[]) => ( {hotkeys.map((hotkey, i) => ( @@ -377,6 +385,22 @@ export default function HotkeysModal({ children }: HotkeysModalProps) { {renderHotkeyModalItems(unifiedCanvasHotkeys)} + + + + +

{t('hotkeys.nodesHotkeys')}

+ +
+
+ + {renderHotkeyModalItems(nodesHotkeys)} + +