4

I have this program to read [code].txt files, according to what is the input on a textBox. For now, I type the code and make the search for the files.

But I want to use a reading of a data matrix code as the input of that textBox.

Basically, I need my program to read a data matrix code and use it to search the files.

Is that possible? Instead of using the keyboard to write the code, I would use a DataMatrix reader...

If so, do you have any tips that I could use to do it?

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
Renato Parreira
  • 758
  • 1
  • 6
  • 23

1 Answers1

1

The most tightly integrated approaches are generally specific to each reader type (they have different APIs), but most readers have a mode where they emulate keyboard input, with optional delimiters at the end of the text. If you make your GUI respond to the 'Enter' key within the text entry field as the same as pressing 'Submit' (or whatever else fires off the file reading in your application), then you can bring in most code readers transparently and still support keyboard interaction in the same way.

Dan Bryant
  • 26,669
  • 3
  • 48
  • 98
  • Let me see if get this right... With the reader i can set a "button" to submit the reading at the text field?? Example: I read the code. Press F1 to submit that code to the text field? – Renato Parreira Oct 29 '12 at 22:37
  • I'm going to use this reader: http://www.honeywellaidc.com/en-US/Pages/Product.aspx?category=Area%20Imager&cat=HSM&pid=1900 – Renato Parreira Oct 29 '12 at 22:58
  • 1
    @Renato, you'll have to check the documentation for your particular reader, but most actually ship in the keyboard-emulating mode. You typically configure the reader by scanning special barcodes printed in the manual, which will allow you to modify the 'end of line' character that gets sent to the keyboard after a barcode is read. By default this is usually the Enter key, so as long as your software interprets the Enter key on the keyboard as submission, you're good to go. – Dan Bryant Oct 29 '12 at 23:06