Re: Grabbing characters from a Symbol barcode scanner

Jiri Kosina <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Wed, 30 May 2007, Andy Stewart wrote:

> I have a Symbol USB barcode scanner that appears to work with Linux.  
> If I bring up a Konsole window and give it focus, characters are typed 
> into that window as I scan barcodes. However, what I'd like to do is 
> grab those characters in a C program.  I suppose that I should be able 
> to open the proper device and the characters would be available.  

Yes, just open the proper evdev interface in /dev/input/event<X> and read 
the events directly from there. See Documentation/input/input.txt, section 
5.

You can use ioctl(EVIOCGID) to obtain vendor id/product id corresponding 
to the given input device, so you can easily look up the event device 
corresponding to the device you are looking for.

-- 
Jiri Kosina

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.