quantumpotato quantumpotato - 3 months ago 9
Javascript Question

Differentiate which keyboard (not key) was pressed in Javascript

I have 2 USB keyboards plugged in. How can I determine which one was pressed?

I can use

keyCode
for my events but I don't see something about getting a read on which keyboard was used.

Gamepads, on the other hand, have an index for which gamepad in the navigator's list was used. I'm looking for something like that.

Answer

How can I determine which one was pressed?

You can't. KeyboradEvent doesn't contain such information.