second USB keyboard (bar code reader) with fixed layout?

Franta Hanzlík franta at hanzlici.cz
Sun Aug 27 23:15:42 UTC 2017


I have main USB keyboard with two national layouts (cs,us) and USB bar
code reader, which behaves as keyboard (without possibility to send
numeric keypad codes). Default bahavior is, that bar code reader output
is interpreted according to layout group settings - what is bad, because
when layout is "cs" (95+% of cases), then bar code is interpreted as
national characters (e.g. +ěščřžýáíé instead of right 1234567890).
Thus I need setting, where layout toggling affects only real keyboard,
while barcode reader "keyboard" stays always in "us" layout.

The best result I was able to achieve was with this configuration in
'/etc/X11/xorg.conf.d/' (0x04b4:0x0100 is barcode reader USB ID) :

"15-keyboard2.conf":
====================
Section "InputClass"
	Identifier "15-barcodeReader"
	MatchIsKeyboard "on"
	MatchUSBID "04b4:0100"
	Option "XkbLayout" "us"
EndSection

"17-keyboard.conf":
===================
Section "InputClass"
	Identifier "17-system-keyboard"
	MatchIsKeyboard "on"
	NoMatchUSBID "04b4:0100"
	Option "XkbLayout" "cz,us"
	Option "XkbOptions" "grp:lwin_toggle,grp_led:scroll"
EndSection

This configuration behaves better, but has also some glitch:

- barcode reader is always set as "us" - which is fine

- when main keyboard is set to "cs" layout, then after barcode is
(correctly) scanned, main keyboard stay in "cs" layout - which is
also right.

- BUT when main keyboard is set to "us" layout, after barcode is
(also correctly) scanned, main keyboard not stay in "us", but is
toggled to "cs" - and moreover ScrollLock LED stays ON, as in "us"
layout.
Right behavior should be not not switching main keyboard to "cs",
it should stay in "us" layout, same as it was before barcode scanning.

I'm probably doing a mistake somewhere, but I can not figure out
where. I'm using Xorg server v1.19.3, evdev driver v2.10.5 and
xkb-utils v7.7.
Can, please, anyone advise me?


Thanks, Franta
--
I hope the Fedora will have a better init and no binary logs


More information about the xorg mailing list