Дюкарь ([info]duke_igthorn) wrote in [info]xkbconfig,

... libwhat?

There is probably a bit too many libraries related to the keyboard - in X Window System in general, and GNOME in particular. In order to explain their not-too-complex relationships and their places in the whole puzzle, I am giving some short reference here.

libxkbfile

Language: C
Licence: X11
Bugzilla: Xorg

Strictly speaking, this library does not exist. Well, technically it does - but it was never meant to be public. Well, unfortunately it is de facto public now - for a long while. Why? Because there are several things in XKB which have never got proper network-transparent solution. In particular - dealing with keyboard configuration in terms of rules/models/layouts/variants/options (RMLVO). In the reference X Window System implementation, libxkbfile is handling RMLVO. It was originally designed as internal library linked to X server and several command line utilities like xkbcomp and setxkbmap. It was never network-transparent, it works with local keyboard configuration database files directly - which means it cannot properly support with remote X server (except for special environments using NFS etc).

This is one of many dark corners of X - the library which should not be used by anything but X implementation internally - but it is actually used quite often.

This library is installed as a part of standard Xorg or XFree86 installation.

Commercial implementations of X may be shipped without this library. Or have this library broken. Or have XKB implementation which does not use this library. All these scenarios create a lot of troubles for "bad" (from X Window architecture POV) applications using it. The authors of these applications usually realize this fact - but they have no choice (the only alternative for them is some kind of functional regression).
In the long run, the applications will use new version of XKB protocol which would provide network-transparent solution. But for the "old" servers, they'd have to link to libxkbfile for many years to come.

libxklavier

Language: C
Licence: LGPL
Bugzilla: none

This library was created in attempt to generalize (and make environment-independent) the code dealing with XKB, from the GNOME keyboard indicator applet. It contains a lot of utility code for accessing the keyboard configuration in terms of RMLVO, tracking the keyboard state etc. Its purpose is to provide a foundation for applications like keyboard layout indicators and monitors, keyboard configurators, layout-aware window managers etc.

Initially the library depended on X Window and libxml2 APIs only. Later (during the GNOME 2.15 release cycle), it was ported to gobject-based architecture.

Currently, it is used in production in GNOME only - but it is also used in ongoing KDE4 development (as optional dependency).

The library uses libxkbfile internally, it also accesses keyboard configuration registry file locally. This makes applications using it "bad citizens" in X Window world (there is standing bug report in GNOME bugzilla). Once new version of XKB is provided, the network transparency is going to be restored (for conformant X servers).

The compatibility with original X Window keyboard handling ("xmodmap") is maintained but with low priority.

libgnomekbd

Language: C
Licence: LGPL
Bugzilla: GNOME

The internal GNOME library emerged from two virtual modules in GNOME CVS: libgswitchit and libkbdraw. The merger was performed during 2.17 development cycle, the original modules were immediately declared deprecated. The library contains GNOME code related to the keyboard: keyboard indicator widget (including plugin management), keyboard drawing widget, saving/loading configuration to GConf etc.

  • Post a new comment

    Error

  • 4 comments

[info]dmitrmax

April 9 2007, 22:17:27 UTC 5 years ago

So, none of them should be used until new XKB protocol will be ready, right? :)

What's the current status of this work? I mean new XKB protocol design/implementation?

[info]duke_igthorn

April 9 2007, 22:24:57 UTC 5 years ago

Daniel Stone is working on it. We had some informal discussions...

PS Well, you can use it all - as long as you're aware of the implications;)

[info]bogado

May 17 2007, 18:35:27 UTC 5 years ago

Question about keyboards....

I don't know if you're the right person to ask, but since you seem to be all knowledgeable in this X keyboard business I will try anyway. :-P

I have a problem with my laptop where the internal keyboard is a standard US keyboard but I sometimes use a ABNT (Brazilian layout) external, when I am using at home in the home-office. The problem arises because the abnt model has more keys than the US model, so even though I can change back and forth from the 'br' layout to the us-intl layout neither one of them work correctly with the other's model.

I managed to hack some files in the X11 keyboard configuration in such a way that I could configure the model to abnt and use the US layout in the original keyboard. This works, but it is hackish. The best solution is to have a way to configure each keyboard with it's own model. Is there a way to do this?

[info]duke_igthorn

May 17 2007, 20:31:46 UTC 5 years ago

Re: Question about keyboards....

AFAIK currently the answer is "no". But I heard input hotplugging is a hot issue in Xorg development these days. So may be quite soon the answer is going to be "yes". Stay tuned.
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…