Skip to content

Commit

Permalink
fix dialog shortcut issue
Browse files Browse the repository at this point in the history
possibly fixes #1919
  • Loading branch information
mifi committed Mar 14, 2024
1 parent 762072a commit 96baa9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2148,9 +2148,15 @@ function App() {
toggleKeyboardShortcuts,
toggleSettings,
openSendReportDialog: () => { openSendReportDialogWithState(); },
detectBlackScenes,
detectSilentScenes,
detectSceneChanges,
detectBlackScenes: ({ keyup }) => {
if (keyup) detectBlackScenes();
},
detectSilentScenes: ({ keyup }) => {
if (keyup) detectSilentScenes();
},
detectSceneChanges: ({ keyup }) => {
if (keyup) detectSceneChanges();
},
createSegmentsFromKeyframes,
toggleWaveformMode,
toggleShowThumbnails,
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useKeyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { useEffect, useRef } from 'react';
// Also document.addEventListener needs custom handling of modifier keys or C will be triggered by CTRL+C, etc
import Mousetrap from 'mousetrap';

const keyupActions = new Set(['seekBackwards', 'seekForwards']);
// for all dialog actions (e.g. detectSceneChanges) we must use keyup, or we risk having the button press inserted into the dialog's input element right after the dialog opens
// todo use keyup for most events?
const keyupActions = new Set(['seekBackwards', 'seekForwards', 'detectBlackScenes', 'detectSilentScenes', 'detectSceneChanges']);

export default ({ keyBindings, onKeyPress: onKeyPressProp }) => {
const onKeyPressRef = useRef();
Expand Down

0 comments on commit 96baa9a

Please sign in to comment.