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';
|
import InpaintingSplitLayoutControl from './InpaintingControls/InpaintingSplitLayoutControl';
|
||||||
|
|
||||||
const InpaintingControls = () => {
|
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 (
|
return (
|
||||||
<div className="inpainting-settings">
|
<div className="inpainting-settings">
|
||||||
<div className="inpainting-buttons-group">
|
<div className="inpainting-buttons-group">
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
import {
|
import {
|
||||||
RootState,
|
RootState,
|
||||||
useAppDispatch,
|
useAppDispatch,
|
||||||
@ -12,6 +13,7 @@ import {
|
|||||||
InpaintingState,
|
InpaintingState,
|
||||||
setIsSpacebarHeld,
|
setIsSpacebarHeld,
|
||||||
setShouldLockBoundingBox,
|
setShouldLockBoundingBox,
|
||||||
|
toggleShouldLockBoundingBox,
|
||||||
toggleTool,
|
toggleTool,
|
||||||
} from '../inpaintingSlice';
|
} from '../inpaintingSlice';
|
||||||
|
|
||||||
@ -56,6 +58,20 @@ const KeyboardEventManager = () => {
|
|||||||
const wasLastEventOverCanvas = useRef<boolean>(false);
|
const wasLastEventOverCanvas = useRef<boolean>(false);
|
||||||
const lastEvent = useRef<KeyboardEvent | null>(null);
|
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(() => {
|
useEffect(() => {
|
||||||
const listener = (e: KeyboardEvent) => {
|
const listener = (e: KeyboardEvent) => {
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user