Therefore, it is better to keep the input field focused unless we finish scanning. To implement that, setInterval() can help us to do that by keep setting the input filed focused.
The javascript:
$().ready(function() {
var locked;
$("#lock").click(function(){
locked = window.setInterval(function(){
$("#focused").focus();}, 200);
});
$("#release").click(function(){
if(locked){
$("#focused").blur();
window.clearInterval(locked);
}
});
});
The html:
lock focus