Jump to content

[SOLVED] USB Barcode reader hook?


Recommended Posts

Hi,

Just wondered if anyone had any experience with this...

Where I work we use lots of barcodes and hand-held barcode readers. Up till now I have been writing programs to accept data from the scanner by just focusing a standard input box. Continuously polling the input box for data change means you can get the program to 'react' to someone scanning a barcode.

Is there any way I can get a direct hook to the USB input device rather than polling an input box? It would be great to not have the program keep re-focusing on the input box just waiting for a scan.

I guess it would be something along the lines of _IsPressed which hooks the keyboard.

Thanks!

Edited by andybiochem
- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

Never mind, I found out how to do this.

Normally I would post my solution to the problem, but it involved hooking the keyboard (the computers recognise a USB barcode reader as a keyboard input apparently), and could easily be converted to a key logger.

Sufficient to say the solution is all done within AutoIT, and is all documented in the help file!!!!

I've been using AutoIT for about a year now, and I'm always amazed at the breadth and depth of the language. AutoIT is a STUNNING prog.

:P

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

Never mind, I found out how to do this.

Normally I would post my solution to the problem, but it involved hooking the keyboard (the computers recognise a USB barcode reader as a keyboard input apparently), and could easily be converted to a key logger.

Sufficient to say the solution is all done within AutoIT, and is all documented in the help file!!!!

I've been using AutoIT for about a year now, and I'm always amazed at the breadth and depth of the language. AutoIT is a STUNNING prog.

:P

That's useful to know, I wouldn't have expected that. Is that normal for a barcode reader do you think? Presumably there was no special driver needed for the barcode reader or is it the driver that makes it look like a keyboard?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I setup a few dozen symbol scanners on our warehouse computers.

They had loads of options on how to interface them and what to emulate if anything.

I set them all up to emulate keyboards because some of the other modes wouldn't work in all applications.

-Kenny

That's useful to know, I wouldn't have expected that. Is that normal for a barcode reader do you think? Presumably there was no special driver needed for the barcode reader or is it the driver that makes it look like a keyboard?

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

I setup a few dozen symbol scanners on our warehouse computers.

They had loads of options on how to interface them and what to emulate if anything.

I set them all up to emulate keyboards because some of the other modes wouldn't work in all applications.

-Kenny

Thanks Kenny.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 8 months later...

Never mind, I found out how to do this.

Normally I would post my solution to the problem, but it involved hooking the keyboard (the computers recognise a USB barcode reader as a keyboard input apparently), and could easily be converted to a key logger.

Sufficient to say the solution is all done within AutoIT, and is all documented in the help file!!!!

I've been using AutoIT for about a year now, and I'm always amazed at the breadth and depth of the language. AutoIT is a STUNNING prog.

:)

I am attempting to develop an application to scan barcodes and am running into the same challenges. Any code snippets you could throw my way would be appreciated.

Link to comment
Share on other sites

I am attempting to develop an application to scan barcodes and am running into the same challenges. Any code snippets you could throw my way would be appreciated.

Don't worry about responding I figured it out myself ... Very helpful group. NOT ...

Link to comment
Share on other sites

Thanks Kenny.

If that is of any interest to you, or to someone here, most BC scanners in PC keyboard emulation (driverless) mode will send "compose" sequences.

For instance, suppose the BC reader needs to send the digit '8', which is ASCII 0x38 or decimal 56, it would typically send:

Alt key down

Numeric keypad '0' down

Numeric keypad '0' up

Numeric keypad '5' down

Numeric keypad '5' up

Numeric keypad '6' down

Numeric keypad '6' up

Alt key up

This is the same sequence of keys one would use to _compose_ the digit '8' under Windows. This way, it can send ASCII alpha without worrying about "keyboard" layout and key translation (QWERTY, AZERTY, ...). Unfortunately this also makes it the slowest interface.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...