From 2baf825f345d65abb857f016faeaaa9932d16d30 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:17:40 +1000 Subject: [PATCH] feat(ui): fix delete layer hotkey --- .../controlLayers/hooks/useCanvasDeleteLayerHotkey.ts | 5 ++++- .../gallery/components/ImageViewer/CurrentImageButtons.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts b/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts index 2d248b15ec..0baa6823d9 100644 --- a/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts +++ b/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts @@ -28,5 +28,8 @@ export function useCanvasDeleteLayerHotkey() { [selectedEntityIdentifier, isStaging] ); - useHotkeys('shift+d', deleteSelectedLayer, { enabled: isDeleteEnabled }, [isDeleteEnabled, deleteSelectedLayer]); + useHotkeys(['delete', 'backspace'], deleteSelectedLayer, { enabled: isDeleteEnabled }, [ + isDeleteEnabled, + deleteSelectedLayer, + ]); } diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CurrentImageButtons.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CurrentImageButtons.tsx index 65131dd3e5..1364307f8c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CurrentImageButtons.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CurrentImageButtons.tsx @@ -101,7 +101,7 @@ const CurrentImageButtons = () => { [isUpscalingEnabled, imageDTO, shouldDisableToolbarButtons, isConnected, isImageViewerActive] ); - useHotkeys('delete', handleDelete, { enabled: isImageViewerActive }, [imageDTO, isImageViewerActive]); + useHotkeys(['delete', 'backspace'], handleDelete, { enabled: isImageViewerActive }, [imageDTO, isImageViewerActive]); return ( <>