Hotkey Cleanup

- Viewer is now Z
- Canvas Move tool is V - sync with PS
- Removed some unused hotkeys
This commit is contained in:
blessedcoolant 2022-11-19 22:33:39 +13:00
parent e7f670a5b6
commit cde395e02f
5 changed files with 8 additions and 42 deletions

View File

@ -59,7 +59,7 @@ const IAICanvasOutpaintingControls = () => {
const canvasBaseLayer = getCanvasBaseLayer();
useHotkeys(
['m'],
['v'],
() => {
handleSelectMoveTool();
},
@ -193,8 +193,8 @@ const IAICanvasOutpaintingControls = () => {
<IAICanvasBrushButtonPopover />
<IAICanvasEraserButtonPopover />
<IAIIconButton
aria-label="Move (M)"
tooltip="Move (M)"
aria-label="Move (V)"
tooltip="Move (V)"
icon={<FaArrowsAlt />}
data-selected={tool === 'move' || isStaging}
onClick={handleSelectMoveTool}

View File

@ -5,7 +5,6 @@ import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
import {
setShouldShowBoundingBox,
setTool,
toggleShouldLockBoundingBox,
} from 'features/canvas/store/canvasSlice';
import { useAppDispatch, useAppSelector } from 'app/store';
import { useRef } from 'react';
@ -47,18 +46,6 @@ const useInpaintingCanvasHotkeys = () => {
const canvasStage = getCanvasStage();
// Toggle lock bounding box
useHotkeys(
'shift+w',
() => {
dispatch(toggleShouldLockBoundingBox());
},
{
preventDefault: true,
},
[activeTabName]
);
useHotkeys(
'shift+h',
() => {

View File

@ -52,7 +52,7 @@ export default function HotkeysModal({ children }: HotkeysModalProps) {
{
title: 'Toggle Viewer',
desc: 'Open and close Image Viewer',
hotkey: 'V',
hotkey: 'Z',
},
{
title: 'Toggle Gallery',
@ -161,7 +161,7 @@ export default function HotkeysModal({ children }: HotkeysModalProps) {
{
title: 'Move Tool',
desc: 'Allows canvas navigation',
hotkey: 'M',
hotkey: 'V',
},
{
title: 'Quick Toggle Move',

View File

@ -94,13 +94,9 @@ export default function InvokeTabs() {
dispatch(setActiveTab(4));
});
useHotkeys('6', () => {
dispatch(setActiveTab(5));
});
// Lightbox Hotkey
useHotkeys(
'v',
'z',
() => {
dispatch(setIsLightBoxOpen(!isLightBoxOpen));
},

View File

@ -1,7 +1,6 @@
import { Tooltip } from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit';
import { ReactNode } from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import { VscSplitHorizontal } from 'react-icons/vsc';
import { RootState, useAppDispatch, useAppSelector } from 'app/store';
import ImageGallery from 'features/gallery/components/ImageGallery';
@ -34,30 +33,14 @@ type InvokeWorkareaProps = {
const InvokeWorkarea = (props: InvokeWorkareaProps) => {
const dispatch = useAppDispatch();
const { optionsPanel, children, styleClass } = props;
const {
showDualDisplay,
isLightBoxOpen,
shouldShowDualDisplayButton,
} = useAppSelector(workareaSelector);
const { showDualDisplay, isLightBoxOpen, shouldShowDualDisplayButton } =
useAppSelector(workareaSelector);
const handleDualDisplay = () => {
dispatch(setShowDualDisplay(!showDualDisplay));
dispatch(setDoesCanvasNeedScaling(true));
};
// Hotkeys
// Toggle split view
useHotkeys(
'shift+j',
() => {
handleDualDisplay();
},
{
enabled: shouldShowDualDisplayButton,
},
[showDualDisplay]
);
return (
<div
className={