Linux – barcode scanner input when running xorg and evdev

inputlinuxxorg

When I scan a barcode in a text console (CTRL+ALT+F1 or not running X) I get the correct input, but when I try with an application running on X, I don't get the correct barcode.

The scanner is configured to return the barcode followed by an 'n'. Under X I only get the 'n', not the preceding barcode.

I ran xev to see what is going on. Here is an excerpt of the output:

> KeyPress event, serial 35, synthetic NO, window 0x6800001,
>     state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
> KeyRelease event, serial 35, synthetic NO, window 0x6800001,
>     state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
> KeyPress event, serial 35, synthetic NO, window 0x6800001,
>     state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
> KeyRelease event, serial 35, synthetic NO, window 0x6800001,
>     state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,

There is one KeyPress/KeyRelease event pair for every digit in the barcode, but no events happening between the KeyPress and KeyRelease event for Alt_L?

Should I look at compose keys for a solution, or how can I match the behavior of a normal console?

ps. I am using a Welch Allyn ST3400 barcode scanner.

EDIT:

I ran showkey on the command line and scanned in a barcode. This is the output I got:

keycode  28 release
keycode  56 press
keycode  82 press
keycode  76 press
keycode  80 press
keycode  56 release
keycode  56 press
keycode  82 press
keycode  75 press
keycode  73 press
keycode  56 release

It seems that the barcode scanner is using Left-Alt+#+#+# to get the correct characters. It also seems like the barcode scanner never sends a release event for the numpad keys that it used together with Left-Alt? I read something similar on a different forum – without a solution though. If I manually use Left-Alt+#+#+# with showkey, I get press and release for each key.

The question now becomes, why is there no KeyPress event when I am running Xorg?

Best Answer

Often you can reconfigure your barcode reader to output better usable output. The configuration is often done by scanning special barcodes - look at the documentation.

Related Question