[Sugar-devel] XO-1 keyboard issues, partial setxkbmap workaround

Sayamindu Dasgupta sayamindu at gmail.com
Fri Mar 20 18:56:17 EDT 2009

On Sun, Mar 15, 2009 at 11:56 AM, S Page <skierpage at gmail.com> wrote:
> (including fedora-olpc-list)
> I think there are three Fedora XO-1 keyboard bugs:
> 1. Any Rawhide should auto-detect you have an OLPC keyboard.  The hal
> and evdev bits and pieces are there, yet it doesn't work.  I filed
> <https://bugzilla.redhat.com/show_bug.cgi?id=490310>.  I made n00b
> notes at http://wiki.laptop.org/go/User:Skierpage/Redhat-XO_OLPC_keyboard
> 2. Although OLPC keymap is in Rawhide, there's dispute over the exact
> contents, e.g. the Frame key and brightness vs. function keys.
> Existing bugs <http://dev.sugarlabs.org/ticket/291> and
> <https://bugzilla.redhat.com/show_bug.cgi?id=468744>
> I'm really confused if this needs to be fixed in /usr/share/hal or in
> /usr/share/X11/xkb or both.
> 3. OLPC keyboard variants should appear in system-config-keyboard and
> the Gnome desktop manager "first boot" keyboard selector.  Only the
> latter has a few Afghanistan OLPC keyboard layouts, none of them has
> "U.S. English (olpc)".    I filed
> <https://bugzilla.redhat.com/show_bug.cgi?id=490311> for
> system-config-keyboard, I don't know if the "first boot" GDM keyboard
> selector should be a different bug.
> It ought to Just Work :-) , but they've been saying that about X
> keyboard handling for about 20 years.
> Regarding 3, Martin Dengler made additional progress on this one in
> his message.  I don't know how Fedora builds that hardcoded list of
> keyboards, and I don't know where /etc/sysconfig/keyboard gets set.

(Sorry for not responding to this earlier)

We need to add a HAL fdi file for the XO so that the frame key (and a
few other keys) works. In the OLPC builds earlier, I think this was
set by setolpckeys[1]. I'm trying to come up with a HAL fdi file which
works, but for some reason, <match
contains="OLPC"> does not seem to work (on removing that line, it
seems to work fine in the latest Soas2 image - Soas2-200903131725).
I'm not sure why this is happening (and I'm too sleepy at the moment
to investigate thoroughly).

The keyboard layout information in an XO is stored in the mfg-data -
see http://wiki.laptop.org/go/Mfg-data#Keyboards for details. In
earlier builds, the mfg-data would be read by the olpc-configure[2]
script, which would write this data to /etc/sysconfig/keyboard
The data in /etc/sysconfig/keyboard would then be read by the
olpc-session script[3], and maybe we can change
/home/liveuser/.Xclients to contain whatever that used to be in
olpc-session ?

In the long term, I believe Sugar should have its own keyboard
configuration system, based on libxkb (or maybe libxklavier), and
enable whatever keyboard(s) that is/are chosen by the user during
startup. I believe Martin has been working on a control-panel item to
make this work, and I would be glad to help with this. As Martin
points out, this is going to be a pain, since there is virtually no
way (AFAIK) to manipulate/query xkb stuff using Python - but this
feature needs to be added.


[1] http://dev.laptop.org/git/projects/olpc-utils/tree/src/setolpckeys.c
[2] http://dev.laptop.org/git/projects/olpc-utils/tree/etc/rc.d/init.d/olpc-configure
[3] http://dev.laptop.org/git/projects/olpc-utils/tree/usr/bin/olpc-session

Sayamindu Dasgupta

More information about the Sugar-devel mailing list