[Interest] [SOLVED] Re: no keyboard input on old CentOS

Konrad Rosenbaum konrad at silmor.de
Wed Oct 16 08:50:38 CEST 2013


Hi,

in case anybody else stumbles over this: with a lot of help from Thomas 
Leitner the problem has been solved.

The problem was that legacy versions of CentOS (4.x and 5.x; and probably 
other older distributions as well) contain a very subtle syntactic problem 
that some newer versions of xkbcommon (like the one bundled with Qt) cannot 
handle.

If you have root access on your system: open /usr/share/X11/xkb/rules/base (it 
may also be located under /usr/lib/X11/xkb or /usr/X11R6/lib/xkb or similar) 
in an editor. Look for a line like this:

     btc5113rf btc5126t btc9000 btc9000a btc9001ah btc5090\

("btc5090" immediately followed by a "\" and newline) insert a space before 
the backslash:

     btc5113rf btc5126t btc9000 btc9000a btc9001ah btc5090 \

Problem solved. XKB actually regarded the backslash as part of the keyboard 
layout name instead of as a line continuation. So it gets confused on the next 
line and stops parsing the file altogether, hence no keyboard layouts can be 
found - it doesn't get around to the interesting parts. If your distributor 
modified the file you may have other lines with backslashes lacking space.

If you have trouble locating the problem set the environment variables 
XKB_LOG_LEVEL=debug and XKB_LOG_VERBOSITY=9 (I'm not sure whether the latter 
is actually necessary, but it does not hurt) when you start your Qt program it 
will complain about an unexpected symbol in the line after the problematic 
backslash.

If you do not have root access or there are simply too many systems affected: 
apply the appended patch - it alters the parser routine to recognize the 
backslash as something special.

cd qtbase/src/3rdparty/xkbcommon/src/xkbcomp/
patch -p0 <xkb_rules.diff

Warning: I did not test it for possible other side effects, since I did not 
have time to fully understand the XKB rules syntax.


	Konrad

On Wednesday 18 September 2013 13:29:29 konrad at silmor.de wrote:
> I've got a strange problem here: my Qt program does not accept any
> keyboard input at all, no matter how hard I pound on those keys. It works
> fine with non-Qt and Qt 4.8.
> 
> I get the following output at program start:
> QXcbConnection: Failed to get the primary output of the screen
> Error:    No components returned from XKB rules
> "/usr/share/X11/xkb/rules/xorg"
> Error:    Couldn't look up rules 'xorg', model 'pc105', layout 'de',
> variant '', options ''
> Qt: Failed to compile a keymap
> 
> Qt: 5.1.1 (compiled with built-in XCB: -no-opengl -qpa xcb -qt-xcb)
> GCC: 4.8.1 (compiled it myself, from vanilla sources)
> OS: CentOS release 5.7 (Final) [I know it is horribly old, I have no
> control over this and I have no root]
> CPU: amd64
> X11: X.org 7.1.1; XMing 6.9.0.31
> 
> 
>     Konrad
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131016/9949d5b9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xkb_rules.diff
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131016/9949d5b9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131016/9949d5b9/attachment.sig>


More information about the Interest mailing list