Brian Epstein on 10 Jun 2005 18:26:38 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] linux x windows and a hacked cuecat ps2 barcode scanner


Ok, so I picked up a couple of these barcode scanners off of Ebay.

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&category=14929&item=5206456996&rd=1

They basically have a ps2 wedge, it plugs between your keyboard and your 
computer.  You swipe a barcode (39, UPC, etc) and it types out the 
numbers.  Pretty neat.

The scanner works fine on a linux tty.  Once I get it into xwindows, 
however, everything is screwy.

I'm scanning the UPC off my Mt. Dew bottle.  The code is: 01213104
I run showkey under tty1 and this is what I get:

kb mode was UNICODE
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
keycode  28 release
keycode  56 press
keycode  82 press
keycode  82 release
keycode  75 press
keycode  75 release
keycode  72 press
keycode  72 release
keycode  56 release
keycode  56 press
keycode  82 press
keycode  82 release
keycode  75 press
keycode  75 release
keycode  73 press
keycode  73 release
keycode  56 release
keycode  56 press
keycode  82 press
keycode  82 release
keycode  76 press
keycode  76 release
keycode  82 press
keycode  82 release
keycode  56 release
keycode  56 press
keycode  82 press
keycode  82 release
keycode  75 press
keycode  75 release
keycode  73 press
keycode  73 release
keycode  56 release
keycode  56 press
keycode  82 press
keycode  82 release
keycode  76 press
keycode  76 release
keycode  79 press
keycode  79 release
keycode  56 release
keycode  56 press
keycode  82 press
keycode  82 release
keycode  75 press
keycode  75 release
keycode  73 press
keycode  73 release
keycode  56 release
keycode  56 press
keycode  82 press
keycode  82 release
keycode  75 press
keycode  75 release
keycode  72 press
keycode  72 release
keycode  56 release
keycode  28 press
keycode  28 release

It is interesting that keycode 56 (Alt) keeps popping up.  I'm wondering 
if this is part of the problem.

Anyway, in Xwindows, this causes all types of havoc when I try to scan 
in any application.  When I turn the numlock on, 01213104 gets 
translated into 048049050049051049048 (decimal for 01213104 without the 
final "4").

So, my question is this.  How can I get the correct numbers out of this 
device.  I'm thinking it is a scancode, xmodmap, showkey, kind of error.  
Any ideas?

I'm pretty sure that I don't need to use the cuecat drivers out there 
because this cuecat has been modified to circumnavigate the internal 
encoding.  Why does it work under tty1, and not in X Windows?

Thanks,
ep

-- 
Brian Epstein <ep@epiary.org>
Key fingerprint = F9C8 A715 933E 6A64 C220  482B 02CF B6C8 DB7F 41B4

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug