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 = ({
|
||||
|
||||
@@ -134,6 +134,7 @@ export const DEFAULT_READER_SETTINGS: IReaderSettings = {
|
||||
[ReaderHotkey.TOGGLE_AUTO_SCROLL]: ['space'],
|
||||
[ReaderHotkey.AUTO_SCROLL_SPEED_INCREASE]: ['b'],
|
||||
[ReaderHotkey.AUTO_SCROLL_SPEED_DECREASE]: ['v'],
|
||||
[ReaderHotkey.EXIT_READER]: ['c'],
|
||||
},
|
||||
imagePreLoadAmount: 5,
|
||||
shouldUseAutoWebtoonMode: true,
|
||||
|
||||
@@ -260,6 +260,7 @@ export enum ReaderHotkey {
|
||||
TOGGLE_AUTO_SCROLL,
|
||||
AUTO_SCROLL_SPEED_INCREASE,
|
||||
AUTO_SCROLL_SPEED_DECREASE,
|
||||
EXIT_READER,
|
||||
}
|
||||
|
||||
export interface ReaderPagerProps
|
||||
|
||||
Reference in New Issue
Block a user