feat(shortcut): add ctrl + mouse wheel to zoom in/out, closes #2011 (#2533)

This commit is contained in:
Huang Xin
2025-11-25 00:19:28 +08:00
committed by GitHub
parent fa66e6fca6
commit a54daaaa90
5 changed files with 113 additions and 6 deletions
@@ -36,6 +36,7 @@ import { getBookDirFromLanguage, getBookDirFromWritingMode } from '@/utils/book'
import { useUICSS } from '@/hooks/useUICSS';
import {
handleKeydown,
handleKeyup,
handleMousedown,
handleMouseup,
handleClick,
@@ -224,6 +225,7 @@ const FoliateViewer: React.FC<{
// and more gesture events can be detected in the iframeEventHandlers
detail.doc.isEventListenersAdded = true;
detail.doc.addEventListener('keydown', handleKeydown.bind(null, bookKey));
detail.doc.addEventListener('keyup', handleKeyup.bind(null, bookKey));
detail.doc.addEventListener('mousedown', handleMousedown.bind(null, bookKey));
detail.doc.addEventListener('mouseup', handleMouseup.bind(null, bookKey));
detail.doc.addEventListener('click', handleClick.bind(null, bookKey, doubleClickDisabled));