mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04: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:
@@ -1,4 +1,6 @@
|
||||
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 { useQueueFront } from 'features/queue/hooks/useQueueFront';
|
||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||
@@ -43,6 +45,40 @@ export const useGlobalHotkeys = () => {
|
||||
[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(
|
||||
'1',
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user