mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix up hotkeys
- Add Shift+X back (this has been missing for a long time) - Add secondary toggle options hotkey
This commit is contained in:
parent
acbf10f7ba
commit
f92a5cbabc
@ -436,9 +436,13 @@
|
|||||||
},
|
},
|
||||||
"appHotkeys": "App Hotkeys",
|
"appHotkeys": "App Hotkeys",
|
||||||
"cancel": {
|
"cancel": {
|
||||||
"desc": "Cancel image generation",
|
"desc": "Cancel current queue item",
|
||||||
"title": "Cancel"
|
"title": "Cancel"
|
||||||
},
|
},
|
||||||
|
"cancelAndClear": {
|
||||||
|
"desc": "Cancel current queue item and clear all pending items",
|
||||||
|
"title": "Cancel and Clear"
|
||||||
|
},
|
||||||
"changeTabs": {
|
"changeTabs": {
|
||||||
"desc": "Switch to another workspace",
|
"desc": "Switch to another workspace",
|
||||||
"title": "Change Tabs"
|
"title": "Change Tabs"
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
import { useAppDispatch } from 'app/store/storeHooks';
|
||||||
|
import { useCancelCurrentQueueItem } from 'features/queue/hooks/useCancelCurrentQueueItem';
|
||||||
|
import { useClearQueue } from 'features/queue/hooks/useClearQueue';
|
||||||
import { useQueueBack } from 'features/queue/hooks/useQueueBack';
|
import { useQueueBack } from 'features/queue/hooks/useQueueBack';
|
||||||
import { useQueueFront } from 'features/queue/hooks/useQueueFront';
|
import { useQueueFront } from 'features/queue/hooks/useQueueFront';
|
||||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||||
@ -43,6 +45,40 @@ export const useGlobalHotkeys = () => {
|
|||||||
[queueFront, isDisabledQueueFront, isLoadingQueueFront]
|
[queueFront, isDisabledQueueFront, isLoadingQueueFront]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const {
|
||||||
|
cancelQueueItem,
|
||||||
|
isDisabled: isDisabledCancelQueueItem,
|
||||||
|
isLoading: isLoadingCancelQueueItem,
|
||||||
|
} = useCancelCurrentQueueItem();
|
||||||
|
|
||||||
|
useHotkeys(
|
||||||
|
['shift+x', 'shift+enter'],
|
||||||
|
cancelQueueItem,
|
||||||
|
{
|
||||||
|
enabled: () => !isDisabledCancelQueueItem && !isLoadingCancelQueueItem,
|
||||||
|
preventDefault: true,
|
||||||
|
enableOnFormTags: ['input', 'textarea', 'select'],
|
||||||
|
},
|
||||||
|
[cancelQueueItem, isDisabledCancelQueueItem, isLoadingCancelQueueItem]
|
||||||
|
);
|
||||||
|
|
||||||
|
const {
|
||||||
|
clearQueue,
|
||||||
|
isDisabled: isDisabledClearQueue,
|
||||||
|
isLoading: isLoadingClearQueue,
|
||||||
|
} = useClearQueue();
|
||||||
|
|
||||||
|
useHotkeys(
|
||||||
|
['ctrl+shift+x', 'meta+shift+x'],
|
||||||
|
clearQueue,
|
||||||
|
{
|
||||||
|
enabled: () => !isDisabledClearQueue && !isLoadingClearQueue,
|
||||||
|
preventDefault: true,
|
||||||
|
enableOnFormTags: ['input', 'textarea', 'select'],
|
||||||
|
},
|
||||||
|
[clearQueue, isDisabledClearQueue, isLoadingClearQueue]
|
||||||
|
);
|
||||||
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
'1',
|
'1',
|
||||||
() => {
|
() => {
|
||||||
|
@ -68,6 +68,11 @@ const HotkeysModal = ({ children }: HotkeysModalProps) => {
|
|||||||
desc: t('hotkeys.cancel.desc'),
|
desc: t('hotkeys.cancel.desc'),
|
||||||
hotkey: 'Shift+X',
|
hotkey: 'Shift+X',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t('hotkeys.cancelAndClear.title'),
|
||||||
|
desc: t('hotkeys.cancelAndClear.desc'),
|
||||||
|
hotkey: 'Shift+Ctrl+X / Shift+Cmd+X',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('hotkeys.focusPrompt.title'),
|
title: t('hotkeys.focusPrompt.title'),
|
||||||
desc: t('hotkeys.focusPrompt.desc'),
|
desc: t('hotkeys.focusPrompt.desc'),
|
||||||
@ -76,7 +81,7 @@ const HotkeysModal = ({ children }: HotkeysModalProps) => {
|
|||||||
{
|
{
|
||||||
title: t('hotkeys.toggleOptions.title'),
|
title: t('hotkeys.toggleOptions.title'),
|
||||||
desc: t('hotkeys.toggleOptions.desc'),
|
desc: t('hotkeys.toggleOptions.desc'),
|
||||||
hotkey: 'O',
|
hotkey: 'T / O',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('hotkeys.toggleGallery.title'),
|
title: t('hotkeys.toggleGallery.title'),
|
||||||
|
@ -207,7 +207,7 @@ const InvokeTabs = () => {
|
|||||||
} = usePanel(galleryPanelUsePanelOptions);
|
} = usePanel(galleryPanelUsePanelOptions);
|
||||||
|
|
||||||
useHotkeys('g', toggleGalleryPanel, []);
|
useHotkeys('g', toggleGalleryPanel, []);
|
||||||
useHotkeys('t', toggleOptionsPanel, []);
|
useHotkeys(['t', 'o'], toggleOptionsPanel, []);
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
'f',
|
'f',
|
||||||
() => {
|
() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user