forked from akai/readest
This commit is contained in:
@@ -3,6 +3,7 @@ import { useReaderStore } from '@/store/readerStore';
|
||||
import { useBookDataStore } from '@/store/bookDataStore';
|
||||
import { debounce } from '@/utils/debounce';
|
||||
import { ScrollSource } from './usePagination';
|
||||
import { eventDispatcher } from '@/utils/event';
|
||||
|
||||
export const useMouseEvent = (
|
||||
bookKey: string,
|
||||
@@ -19,7 +20,15 @@ export const useMouseEvent = (
|
||||
debounceScroll('mouse', -msg.data.deltaY, 0);
|
||||
}
|
||||
if (msg.data.type === 'iframe-wheel') {
|
||||
debounceFlip(msg);
|
||||
if (msg.data.ctrlKey) {
|
||||
if (msg.data.deltaY > 0) {
|
||||
eventDispatcher.dispatch('zoom-out', { factor: Math.abs(msg.data.deltaY) / 100 });
|
||||
} else if (msg.data.deltaY < 0) {
|
||||
eventDispatcher.dispatch('zoom-in', { factor: Math.abs(msg.data.deltaY) / 100 });
|
||||
}
|
||||
} else {
|
||||
debounceFlip(msg);
|
||||
}
|
||||
} else {
|
||||
handlePageFlip(msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user