LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-03-2009, 03:05 AM   #1
dogfuel
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Rep: Reputation: 0
log scanned barcodes (posing as keystrokes) using python and evdev.py


I have a barcode scanner that, like most, injects the scanned string and a lf as text from a keyboard. Rather than scan data into an application, I'd like to simply log the time of the scan and barcode data scanned to a file.

I'm so new to this I feel like an idiot but assume I can loop and and use evdev.py to distinguish between the "real" keyboard and the scanner (scanner is on /dev/input/event7). My question is how to detect the scan, write the characters to a file and, if possible, stop the barcode "keystrokes" from getting to X.

So far:

PHP Code:
import evdev
scanner_location 
'/dev/input/event7'  # get the correct one from HAL or so
scanner_device evdev.Device(scanner_location)

while 
1:
    
scanner_device.poll() 
In my ignorance, I do not know what to test in the loop and what do next ... please help
 
  


Reply

Tags
barcode, evdev



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me log keystrokes on my USB keyboard? Arancaytar Linux - Software 1 03-04-2009 04:11 PM
Using escape codes to print barcodes c2tidis Linux - Software 0 09-29-2005 11:44 AM
Posing a new security measure..... zhizaki Slackware 4 09-28-2005 11:13 PM
120GB HDD posing as 2.5GB Azriphale Linux - Hardware 1 09-04-2003 09:09 AM
barcodes/fonts vressue Linux - General 1 01-27-2003 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration