Hotkeys improvement

This commit is contained in:
psychedelicious 2022-11-12 23:59:17 +11:00 committed by blessedcoolant
parent 7831468304
commit 0a2e67df1a

View File

@ -48,24 +48,22 @@ const useInpaintingCanvasHotkeys = () => {
// Toggle lock bounding box // Toggle lock bounding box
useHotkeys( useHotkeys(
'shift+w', 'shift+w',
(e: KeyboardEvent) => { () => {
e.preventDefault();
dispatch(toggleShouldLockBoundingBox()); dispatch(toggleShouldLockBoundingBox());
}, },
{ {
scopes: ['inpainting', 'outpainting'], preventDefault: true,
}, },
[activeTabName] [activeTabName]
); );
useHotkeys( useHotkeys(
'shift+h', 'shift+h',
(e: KeyboardEvent) => { () => {
e.preventDefault();
dispatch(setShouldShowBoundingBox(!shouldShowBoundingBox)); dispatch(setShouldShowBoundingBox(!shouldShowBoundingBox));
}, },
{ {
scopes: ['inpainting', 'outpainting'], preventDefault: true,
}, },
[activeTabName, shouldShowBoundingBox] [activeTabName, shouldShowBoundingBox]
); );
@ -94,7 +92,7 @@ const useInpaintingCanvasHotkeys = () => {
{ {
keyup: true, keyup: true,
keydown: true, keydown: true,
scopes: ['inpainting', 'outpainting'], preventDefault: true,
}, },
[tool, previousToolRef] [tool, previousToolRef]
); );