USB scanner DS4208 - emulate keypad option

Hello there,

I have a question regarding scanner behaviour, which I find odd. I have a USB scanner Motorola DS4208 that is configured as USB HID Keyboard + Emulate Keypad option. Emulate Keypad means: Enable this to send all characters as ASCII sequences over the numeric keypad. For example ASCII A transmits as
“ALT make” 0 6 5 “ALT Break”.

When I try to scan a barcode into console, the barcode transmits itself as number values as ASCII sequences. However in virtual console (Ctrl + alt + f1) the barcode is scanned correctly. Can I somehow replicate this behaviour in X11 or is it not possible?

Many thanks

I do not completely follow you on how you tested things in the GUI, but it is clear that things working for a virtual console (Ctrl + Alt + F1)

Can you open a console window in the GUI and make that active and copy what you see printed there?

When I scan the QR code in virtual console, the output is this:


Which is correct.

When I scan the QR code in GUI terminal or anywhere in GUI, the ouput is this:


Please, please, you have only output. We like to see the command also. Now we do not know what you are doing to get the output.

And please use the </> button around copied/pasted computer text.

You mean the barcode I am trying to scan with the scanner?

Things like “GUI terminal” are vague. What are you exactly doing. We can not look over your shoulder.

In the virtual console, are you logged in? I lack the fantasy to understand what is happening.

Plug in the USB scanner, then have a QR code printer on paper. OpenSUSE Tumbleweed → open terminal or any text editor for that mattter to test the output of the scanner. Then I try to scan the QR code with the scanner and the output in GUI is the numbers I sent in my first porst. But when I press ctrl + alt + F1 and then login in the virtual console (not necessary) I scan the barcode and the QR scode is scanned properly.

OK, thus what you see is the echo on the terminal (TTY emulator) as if you typed this as a command.

And that GUI is? KDE, Gnome, …

To make it a bit clear what you see echoed in the GUI.
It is the decimal representation of the characters:

P -> 080
C -> 067
G -> 071

Byt Why? Which component is doing this?

Xfce GUI. The emulate keypad option is doing that which is a configuration of the scanner. I am wondering if I can somehow replicate virtual console’s behaviour in X11.

Isn’t XFCE using X11?

Well yes it is indeed. I wonder what the mechanism is. Why exactly does scanning into virtual console works and does not work in GUI.

The scanning works, else you would not see the decimal presentation of the characters you expect.

There is some mechanism that “translates” those characters and sends those three digit decimals.

Hm, not easy :frowning:

Exactly but the mechanism is not applied in virtual console. If only we knew if it’s possible to apply the same in X11.

I am not sure I understand this, but I see there also an A → 065 translation. I guess that the Alt key simulation is not functioning as you think it should.

I tried to simulate what you say the device does and (KDE) started Konsole. Then switch NumLock on. Then pressed down Alt and typed: 0 6 5 0 7 0. This is what happened:

(arg: 65070)

Then I went to Ctrl-Alt-F1 and logged in. Doing the same, I get


So the terminal emulators are behaving different.

I am a bit reluctant to experiment here. And because I use KDE, I am not sure it will help you.

But KDE has System Settings > Input devices > Keyboard. And there is a lot there.

Also, using Konsole, I see (Right-Click > Edit Profile) Keyboard where you can choose between Keyboards. I played with those, but no change.

Maybe look in the XFCE configurations about Keyboard and keys.

Unfortunately I have tried so many options and nothing has worked so far.

It is a pity that no other members seem interested in this problem, or simply do not know any answer or suggestion.

BTW, I do not need the numerical keypad for this. Just pressing Alt and then typing the number keys at the top of the “normal” keyboard gives the same.

Linux obviously knows what is the ASCII representation of a character, let’s say ‘A’ which is 65. When I type this command in virtual console: ‘showkey -a’ and then press the key ‘A’ it shows this:

A 65 0101 0x41

When I press Alt + 65 in virtual console I get ‘A’

The same does not however works in GUI.

During the above discussion we found out that nothing is wrong with the scanner. The problem lies in the interpretation of the pressed down Alt key during the typing of a number. It works as you want (sending the corresponding character) on the virtual console, but not when using konsole (or any other application within a KDE session).

Maybe starting a new thread with a title like “Entering characters by using Alt with decimal number differs on virtual console and konsole” might draw new attention to the problem.

Then describe you found this with the device, but that it can be done using the keyboard solely on the virtual console and konsole (and other programs) in KDE. (and maybe show my examples).

Of course you can place a link there to this thread for completeness.