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?

>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.

Leave a Reply Cancel reply