Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicks not detected when connecting a mouse to iPad #1959

Open
danrha opened this issue Dec 27, 2021 · 1 comment · May be fixed by #1960
Open

Clicks not detected when connecting a mouse to iPad #1959

danrha opened this issue Dec 27, 2021 · 1 comment · May be fixed by #1960
Labels
cat: event-handling status: PR proposed an active pull request should fix this issue

Comments

@danrha
Copy link

danrha commented Dec 27, 2021

Currently Paper.js isn't listening to mouse events (mousedown, mousemove, mouseup) for practically any device supporting ontouchstart. This is causing clicks coming from mice connected to tablets or phones to not be detected by Paper.js tools.

paper.js/src/view/View.js

Lines 1079 to 1090 in 56d153a

mousedown = 'touchstart';
mousemove = 'touchmove';
mouseup = 'touchend touchcancel';
// Do not add mouse events on mobile and tablet devices
if (!('ontouchstart' in window && navigator.userAgent.match(
/mobile|tablet|ip(ad|hone|od)|android|silk/i))) {
// For non pointer events browsers and mixed browsers, like chrome
// on Windows8 touch laptop.
mousedown += ' mousedown';
mousemove += ' mousemove';
mouseup += ' mouseup';
}

I'm creating a PR to remove the check and listen to both touch and mouse events instead of excluding mouse on touch devices.

Description/Steps to reproduce

  1. Create a tool using a mouse event
  2. Click using a mouse connected to a touch device, the event will not be detected

Link to reproduction test-case

https://plnkr.co/edit/vUzAv72ZNODG3aSG

Expected result

Yellow circle should move to the pointer location

Additional information

Tested on iOS & iPadOS 15, should be reproducible on other versions of iOS and Android tablets.

@nicholaswmin
Copy link

+1

@sapics sapics added cat: event-handling status: PR proposed an active pull request should fix this issue labels Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: event-handling status: PR proposed an active pull request should fix this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants