From 5cc80db43863178ad3d7593305eb4dd6a98b3df4 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 1 Feb 2026 16:37:13 +0800 Subject: [PATCH] feat(gesture): support two finger swipe left/right to paginate on trackpad, closes #3127 (#3132) --- apps/readest-app/src/app/reader/hooks/usePagination.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/readest-app/src/app/reader/hooks/usePagination.ts b/apps/readest-app/src/app/reader/hooks/usePagination.ts index e3be4749..845ac9f5 100644 --- a/apps/readest-app/src/app/reader/hooks/usePagination.ts +++ b/apps/readest-app/src/app/reader/hooks/usePagination.ts @@ -182,11 +182,15 @@ export const usePagination = ( !isPanningView(viewRef.current, viewSettings) ) { // The wheel event is handled by the iframe itself in scrolled mode. - const { deltaY } = msg.data; + const { deltaY, deltaX } = msg.data; if (deltaY > 0) { - viewRef.current?.next(1); + viewPagination(viewRef.current, viewSettings, 'down'); } else if (deltaY < 0) { - viewRef.current?.prev(1); + viewPagination(viewRef.current, viewSettings, 'up'); + } else if (deltaX > 0) { + viewPagination(viewRef.current, viewSettings, 'left'); + } else if (deltaX < 0) { + viewPagination(viewRef.current, viewSettings, 'right'); } } else if (msg.data.type === 'iframe-mouseup') { if (msg.data.button === 3) {