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

Is it possible to detect if the touch is from apple pencil or hand? #235

Open
PankajPunia opened this issue Apr 20, 2023 · 1 comment
Open

Comments

@PankajPunia
Copy link

PankajPunia commented Apr 20, 2023

I'm using this library in an iPad app for making notes. When user is using an apple pencil to draw on canvas, i want to draw only with pencil touch not with any other gesture , for example , sometimes, i see unexpected lines and dots because of the palm resting on iPad screen.

Is there a way to handle this case? Is it possible to detect if the touch is from pencil or palm?

@terrylinla @diego-caceres @jeanregisser @artdevgame @toblerpwn

@PankajPunia
Copy link
Author

I kind of resolved it using another approach that helps in avoiding multiple touches. I updated the code in SketchCanvas.js file as follows :

Replaced if (!this.props.touchEnabled) return with if (!this.props.touchEnabled || gestureState.numberActiveTouches > 1) return in onPanResponderGrant, onPanResponderMove and onPanResponderRelease functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant