Suppose I have two textboxes:

```
<input type="text"id="resourceName" placeholder="Resource name"/>
<input type="text" id="barCode"  placeholder="barCode(EAN-13)"/>

```

To populate this textboxes I use **barcode** scanner and keyboard.
What I want is a little bit difficult and I don't know how to do this .
I can't differentiate when user is populating text boxes with keyboard and when with barcode.
I need this becouse i want to implement something like : when user is usign barcode scanner and if we don't have focused textbox ,I want to focus barcode textbox and insert this value in this textbox , and when focused is resourceName textbox , first I want to focus barCode textbox and then to insert this value to this textbox.
I don't want to let user insert barcode in resourceName textbox using barcode scanner .
The problem is that i can't differentiate events , how user is populating textboxex ?, using barcode scanner or using keyboard.
Any help will be appreciated.Thanks a lot