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?
CodePudding user response:
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.
CodePudding user response:
You could possibly make a way to 'switch' from one input device to another by having a clickable spot on the screen which switches the input devices. This way you could capture or seperate the x,y and clicks from each device.