retyui / react-quick-pinch-zoom

A react component that providing multi-touch gestures for zooming and dragging on any DOM element.
https://react-quick-pinch-zoom.netlify.app/
308 stars 46 forks source link

Support touch and mouse at the same time #41

Closed AndreJesusBrito closed 2 years ago

AndreJesusBrito commented 3 years ago

Hi, I have been using quick pinch zoom and I really like it.

I found a problem however, I was trying to use it in a PC but mouse and scroll were not working. Turns out to that the isTouch default function was detecting that this PC supports touch on the screen.

When I force the isTouch to be false, it starts working. This is desirable because after all is a PC, but would be cool if the user could use both mouse or touch if both are supported by his machine.

I don't know if this is already possible to do in the current version but if it is please let me know how.

Thanks :)

aavanzyl commented 3 years ago

I am running into the same issue, also as stated above, its a desktop with touch capabilities that only allows touch events. Also the same request would be a possible way to have both instead of choosing between the two input styles.

retyui commented 2 years ago

Sorry, initially this library was designed for classics event system (touch, mouse) and in not possible to keep them together

I can suggested to use this library for zooming https://github.com/retyui/react-fast-pinch-zoom as it use modern pointer event API, it won't be a problem anymore!