Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to listen to input from two pointing devices (mouse and drawing tablet) simultaneously on the same page?

I would like to listen to events from two different input devices, a mouse and a drawing tablet without them interfering: different events when the mouse is moved or clicked and different events then the stylus is moved or pressed.

Is that possible or does it have to with how the OS receives data from the devices?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

A drawing tablet connected to a computer acts like another mouse. It is the same as connecting a second mouse. Both mice would be controlling the same cursor. Thus, moving the mouse would be the same as moving the stylus, clicking with the mouse would be same as touching the tablet with the stylus. Depending on your setup, interactions with the stylus might be triggering touch events instead of mouse events.

In any case, there isn’t a special category of events providing any additional support ορ functionality for a stylus and a drawing tablet. For JavaScript (and for your broswer) the stylus is no different than your mouse or your finger. So, what you are asking is not possible.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading