Configure the scanner to send a certain prefix and/or suffix, use a character or character sequence that is not likely to be sent by a standard keyboard. In your program then check for these 'markings' and proceed accordingly, stripping the markings from the value you received. This most likely will require you the keep a keyboard buffer since the scanners sends the barcode character by character, so you have to filter it out yourself, resetting your buffer when a full code is received, and so on ... I've used this successfully before with a keyboard wedged scanner, but now i prefer the serial or usb versions wich can be handled throught a serial port, and allthus don't cause keyboard interference risk's.
mvg Orca Belgium ----- Original Message ----- From: "Wim Sterns" <[EMAIL PROTECTED]> To: "Borland's Delphi Discussion List" <[email protected]> Sent: Monday, February 05, 2007 9:41 AM Subject: RE: which keyboard was it > Jerry, Rob, > > Thanks for your replies. > Sorry for my late reaction (I went skiing last week) > > This is what I am trying to do > My PC has a keyboard wedge scanner and a keyboard. > The keyboard is not accesible by the user > The user must swipe his magnetic cards to generate > input in my program. > He has no screen where he can see what is happening. > He just knows that it is scanned correct when the > scanner beeps "OK" > My application always has the focus on an edit > control, so the data gets there and is further > processed. > All this works just fine with ONE scanner. > > Now my problem > I want to add a second scanner (and possibly even a > third) to the PC. > So my question is. How can my application tell which > scanner fills the edit control. > And what if the two scanners are simultanously used? > I suppose the inputs mix up in my edit control? > > So when the keyboard wedge sends a "keystroke" to my > application, I like to know from which scanner is > comes. > >>From what I understand this is not possible? > And I have to buy another type of scanner to do so? > > Is there really no way to differentiate ? > > Thanks > Wim > > > > --- Jerry Sands <[EMAIL PROTECTED]> wrote: > >> The keyboard wedge type of scanner can be handy and >> it can be a pain. I am >> sure Wim wants to control the scanner in some way. >> In my programming I >> prefer to know where the input is coming from. Your >> program needs to be >> ready to accept keyboard input (some control has >> focus and accepts keyboard >> input). In my programming I like to be able to read >> a barcode or a magnetic >> strip from a credit card in the background so to >> speak. >> >> There are USB devices out there that can do that. >> There are also USB >> devices that emulate a keyboard wedge as well - not >> what I want nor >> apparently what Wim is looking for. >> >> Jerry Sands >> >> >> >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf >> Of Rob Kennedy >> Sent: Friday, January 26, 2007 11:41 AM >> To: Borland's Delphi Discussion List >> Subject: Re: which keyboard was it >> >> Wim Sterns wrote: >> > I have a pc with a barcode reader and two >> keyboards >> > attached to it. >> > The barcode reader emulates also a keyboard >> (keyboard >> > wedge) >> > >> > How can I see if a keystroke was sent by one of >> the >> > keyboards (and which) or by the barcode reader ? >> >> No. That's the point of having the barcode scanner >> pretend to be a >> keyboard -- so you *don't* have to write additional >> code to read barcodes. >> >> As far as any user-mode program is concerned, there >> is just one keyboard >> attached to the computer. Even the kernel might not >> know the difference. >> As long as the hardware sends the same signals as a >> keyboard would send, >> it should pass for being the same device. >> >> So, what are you trying to do? >> >> -- >> Rob >> >> >> _______________________________________________ >> Delphi mailing list -> [email protected] >> http://www.elists.org/mailman/listinfo/delphi >> >> _______________________________________________ >> Delphi mailing list -> [email protected] >> http://www.elists.org/mailman/listinfo/delphi >> > > > > > ____________________________________________________________________________________ > Have a burning question? > Go to www.Answers.yahoo.com and get answers from real people who know. > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

