Add hotkey to close reader
This commit is contained in:
@@ -82,6 +82,7 @@ export const ReaderHotkeys = ({
|
||||
} = ReaderService.useSettings();
|
||||
const automaticScrolling = useReaderAutoScrollContext();
|
||||
const { setShowPreview } = useReaderTapZoneContext();
|
||||
const exitReader = ReaderService.useExit();
|
||||
|
||||
const openChapter = ReaderControls.useOpenChapter();
|
||||
const openPage = ReaderControls.useOpenPage();
|
||||
@@ -216,6 +217,7 @@ export const ReaderHotkeys = ({
|
||||
}),
|
||||
[updateSetting, autoScroll.value],
|
||||
);
|
||||
useHotkeys(hotkeys[ReaderHotkey.EXIT_READER], exitReader, [exitReader]);
|
||||
|
||||
useEffect(() => {
|
||||
enableScope(HotkeyScope.READER);
|
||||
|
||||
@@ -36,6 +36,7 @@ const READER_HOTKEY_TO_TITLE: Record<ReaderHotkey, TranslationKey> = {
|
||||
[ReaderHotkey.TOGGLE_AUTO_SCROLL]: 'reader.settings.hotkey.auto_scroll',
|
||||
[ReaderHotkey.AUTO_SCROLL_SPEED_INCREASE]: 'reader.settings.hotkey.auto_scroll_speed_increase',
|
||||
[ReaderHotkey.AUTO_SCROLL_SPEED_DECREASE]: 'reader.settings.hotkey.auto_scroll_speed_decrease',
|
||||
[ReaderHotkey.EXIT_READER]: 'reader.button.exit',
|
||||
};
|
||||
|
||||
export const ReaderSettingHotkey = ({
|
||||
|
||||
Reference in New Issue
Block a user