I have bar code scanner.
Sometimes user wants to search items by bar code.
But he is lazy enough and doens't want to use mouse at all to click on input.
Scanner usually inputs from 8 to 13 symbols very fast, no human types so fast.
It would be perfect solution to (1)detect extremely input and if no input element on the page has focus (2) then to select the input with certain class , fill it with content from scanner and start searching.
Second stage is non-issue. I 've no idea how to start with first stage.
Are there any libraries?
Not perfect solution would be to program bar code reader to begin every entering with some key combination and listen for this key and set focus on necessary input. But this would require extra work of other guys.
Is perfect solution reachable?