Page 1 of 1

Intermec barcode scanner returns CTRL-J when scanning

Posted: Tue Sep 18, 2012 1:45 pm
by Margaret Hawkes
I have plugged in an intermec bardoce scanner into my lapto to check out a barcode scanning application. I scan the required fired, the scanner bleeps and returns the scanned data terminated by CTRL-J. This means that the favorites box is opened every time in internet explorer. In Firefox, it is the download list. How can I get round this problem?

Re: Intermec barcode scanner returns CTRL-J when scanning

Posted: Thu Sep 27, 2012 2:57 pm
by Rob
A couple of options here. The simplest would be to look at the scanner and see if can be configured to send another character other than CTRL-J (ENTER for example) at the end of the scanned data. I would expect this could be changed.

The second option would be to add some JavaScript code to trap the keyboard event so the CTRL-J would be ignored.

I could provide a js code snippet to help here but I would try the scanner configuration first.

Re: Intermec barcode scanner returns CTRL-J when scanning

Posted: Thu Sep 27, 2012 4:29 pm
by Rob
here is some code to trap CTRL J

Code: Select all

document.onkeypress=function(e){
 var e=window.event || e
  
 if (e.charCode && ( e.charCode==106 || e.charCode==74) && e.ctrlKey)
  return false;

 return true;
}