0

I have input box. This input box may have a value as a barcode scanner or user input. But, key event from barcode scanner or user input have same keypress Events. I want to distinguish between these Key Event. Is there a way to tell where the Event is coming from in JavaScript?

Thanks.

I tried to detect it as an event, but I couldn't find any difference.

nanami
  • 1
  • 1
  • No, there is nothing built-in that lets you identify the input. A barcode scanner acts like a keyboard. You _could_ look at the timing of the individual keystrokes, but that'll be complicated and possibly inaccurate – Cerbrus Oct 28 '22 at 07:37
  • Is it a duplicate here? [How do I distinguish between a scanner input and keyboard input in Javascript?](https://stackoverflow.com/q/53573584/9014308) – kunif Oct 28 '22 at 07:44

0 Answers0