
vb.net and barcode scanners
When I said act as keyboard wedges I didn't literally mean that they were
keyboard wedges (although some are). If you barcode scanner does indeed
return the barcoded data to your current active application "just as if I
had type in the barcode from the keyboard", then there is NOTHING that you
need to do to your application to support this.
If you want to capture barcode input into something other than the current,
active app, then you are probably better served by a scanner designed for
that purpose. For example, there are many serial scanners out there that
allow you to capture the data, process it in your application, and do with
it as you see fit without depending on it being a "keystroke stream". The
advantage of these is that you can enter data into other than the current
active field (or not enter it at all!). The downside is that you have to
write code to 1) open the port, 2) process the input stream, etc. Also, if
you're inputting more than one type of barcode data, the data itself will
have to have some identifying characteristic so that you can determine how
to process it (again, if you're not depending on the app being currently
active with an active data entry field).
Will your current USB scanner work in this scenario? Don't know.
Even if it will, can you access it from .NET? Not sure but I'll bet it
requires a driver.
Wayne
Quote:
> I am having a similar problem with a barcode scanner connected to a USB
> port. By default, the scanned barcodes are returned to the current active
> application just as if I had typed in the barcode from the keyboard. In
my
> case, I am not using a keyboard wedge which connects to the barcode
> scanner - the scanner is connected separately to the USB port. What I
want
> to do is capture the USB port I/O (i.e. scanned barcode) and process it
> within my application which can be running in the background. I have
tried
> opening the port using CreateFile() but this only seems to apply to COM
> ports and not USB ports (I couldn't figure out a proper name for this port
> to open it properly? Is there one for USB ports that is similar to COM1,
> Com2, ...). I tried using Microsoft's DirectX (in particluar DirectInput)
> to capture the I/o from the USB port but the list of enumerated devices
that
> I can access through DirectX didn't include my USB port, only the keyboard
> and mouse devices. I was hoping I wouldn't have to write a device driver
> for this?!!! Any help with this problem would be greatly appreciated!
> Thanks, ...bruce.
> > Most of the barcode scanners that act as "keyboard wedges" allow you to
> > specify what the termination character will be (and even if there will
be
> > one. For example, in my environment, we have configured all of the
> scanners
> > to append a tab character to the end of the text stream.
> > If using a "keyboard wedge" type of scanner, there is no special coding
> > required in your app because your app doesn't distinguish between the
> > scanner and a keyboard.
> > Wayne
> > > Hi,
> > > I worked with a barcodescanner in one of my projects before,
> > > but the barcodescanner acted as a keyboard, when the code is scanned
it
> > just
> > > sends a stroke of keys terminated with a Chr(13)
> > > the chr(13) can easely activate the default button (the acceptbutton)
> > > > Anyone know of a code sample or online tutorial that demonstrates
the
> > > > ability of a textbox with focus to receive communication from a
> barcode
> > > > scanner?
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.386 / Virus Database: 218 - Release Date: 9/09/2002