mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Restores shift+q bounding box shortcut
This commit is contained in:
parent
16c8b23b34
commit
6195579910
@ -7,29 +7,6 @@ import InpaintingClearImageControl from './InpaintingControls/InpaintingClearIma
|
||||
import InpaintingSplitLayoutControl from './InpaintingControls/InpaintingSplitLayoutControl';
|
||||
|
||||
const InpaintingControls = () => {
|
||||
// const { shouldShowMask, activeTabName } = useAppSelector(
|
||||
// inpaintingControlsSelector
|
||||
// );
|
||||
|
||||
// const dispatch = useAppDispatch();
|
||||
|
||||
/**
|
||||
* Hotkeys
|
||||
*/
|
||||
|
||||
// Toggle lock bounding box
|
||||
// useHotkeys(
|
||||
// 'shift+q',
|
||||
// (e: KeyboardEvent) => {
|
||||
// e.preventDefault();
|
||||
// dispatch(toggleShouldLockBoundingBox());
|
||||
// },
|
||||
// {
|
||||
// enabled: activeTabName === 'inpainting' && shouldShowMask,
|
||||
// },
|
||||
// [activeTabName, shouldShowMask]
|
||||
// );
|
||||
|
||||
return (
|
||||
<div className="inpainting-settings">
|
||||
<div className="inpainting-buttons-group">
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import {
|
||||
RootState,
|
||||
useAppDispatch,
|
||||
@ -12,6 +13,7 @@ import {
|
||||
InpaintingState,
|
||||
setIsSpacebarHeld,
|
||||
setShouldLockBoundingBox,
|
||||
toggleShouldLockBoundingBox,
|
||||
toggleTool,
|
||||
} from '../inpaintingSlice';
|
||||
|
||||
@ -56,6 +58,20 @@ const KeyboardEventManager = () => {
|
||||
const wasLastEventOverCanvas = useRef<boolean>(false);
|
||||
const lastEvent = useRef<KeyboardEvent | null>(null);
|
||||
|
||||
// Toggle lock bounding box
|
||||
useHotkeys(
|
||||
'shift+q',
|
||||
(e: KeyboardEvent) => {
|
||||
e.preventDefault();
|
||||
dispatch(toggleShouldLockBoundingBox());
|
||||
},
|
||||
{
|
||||
enabled: activeTabName === 'inpainting' && shouldShowMask,
|
||||
},
|
||||
[activeTabName, shouldShowMask]
|
||||
);
|
||||
|
||||
// Manages hold-style keyboard shortcuts
|
||||
useEffect(() => {
|
||||
const listener = (e: KeyboardEvent) => {
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user