Hi,

I've found what I think is a better workaround for the Xephyr problem seen
running sugar-emulator, in which keyboard mappings are not inherited from
the main X server.

One workaround known so far is to go into the Terminal activity
and run

  setxkbmap us

(or whatever keyboard map & options you want).  However, that doesn't fix
all keys,
in particular it doesn't fix the arrow keys (at least for me).  What does
work
is to execute, in a host shell outside of the sugar emulator,

  xkbcomp $DISPLAY :100

replacing :100 with the actual X display of the Xephyr X server;
$DISPLAY is of course the name of the encompassing X display in
which Xephyr runs as a client.   This copies the XKB settings from
the encompassing display to the display under Xephyr.

You have to run xkbcomp after having sent some keyboard events
to Xephyr -- if you do it before that, it seems not to work for some reason
that I don't understand well.

That leads me to a really hackish patch to:

  sugar-jhbuild/source/sugar/bin/sugar-emulator

adding a -k option that does the xkbcomp to copy the XKB settings to
Xephyr before starting sugar.  The most awkward bit is that I had to
add code to put an ugly little window in the Xephyr server waiting for an
initial keystroke before calling xkbcomp.  I know very little about X; maybe
someone can figure out how to avoid that bit.

If you use the patch, start sugar-emulator as follows:

 $ ./sugar-jhbuild run sugar-emulator -k &

Briefly tested only under Fedora 11. Enjoy,

[1] http://dev.sugarlabs.org/ticket/342

Attachment: sugar-emulator.diff
Description: Binary data

_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to