diff --git a/res/icons/20/skip-ahead-granular.svg b/res/icons/20/skip-ahead-granular.svg new file mode 100644 index 000000000..b6c6939ae --- /dev/null +++ b/res/icons/20/skip-ahead-granular.svg @@ -0,0 +1,3 @@ + diff --git a/res/icons/20/skip-back-granular.svg b/res/icons/20/skip-back-granular.svg new file mode 100644 index 000000000..c71549dd3 --- /dev/null +++ b/res/icons/20/skip-back-granular.svg @@ -0,0 +1,3 @@ + diff --git a/src/common/components/utility-popup/read-aloud-popup.js b/src/common/components/utility-popup/read-aloud-popup.js index bb7738830..7b40276fd 100644 --- a/src/common/components/utility-popup/read-aloud-popup.js +++ b/src/common/components/utility-popup/read-aloud-popup.js @@ -7,6 +7,8 @@ import IconSkipBack from '../../../../res/icons/20/skip-back.svg'; import IconPlay from '../../../../res/icons/20/play.svg'; import IconPause from '../../../../res/icons/20/pause.svg'; import IconSkipAhead from '../../../../res/icons/20/skip-ahead.svg'; +import IconSkipBackGranular from '../../../../res/icons/20/skip-back-granular.svg'; +import IconSkipAheadGranular from '../../../../res/icons/20/skip-ahead-granular.svg'; import IconAnnotate from '../../../../res/icons/20/read-aloud-annotate.svg'; import IconLoading from '../../../../res/icons/16/loading.svg'; import IconClock from '../../../../res/icons/12/clock.svg'; @@ -461,6 +463,19 @@ function PlaybackControls(props) { const { l10n } = useLocalization(); let { showOptions, onToggleOptions, showSpinner, paused, onPlayPause, controller, onAddAnnotation, onLockPosition } = props; + let [altDown, setAltDown] = useState(false); + + useEffect(() => { + let handleKey = (event) => { + setAltDown(event.altKey); + }; + window.addEventListener('keydown', handleKey); + window.addEventListener('keyup', handleKey); + return () => { + window.removeEventListener('keydown', handleKey); + window.removeEventListener('keyup', handleKey); + }; + }, []); function handleAddAnnotation() { let segment = controller?.getSegmentToAnnotate(); @@ -470,7 +485,11 @@ function PlaybackControls(props) { } return ( -