keyboard handling (was Re: OLPC where to go development advice.)

S Page info at skierpage.com
Mon Feb 2 18:30:46 EST 2009


Summary: I updated
<http://wiki.laptop.org/go/Enabling_XO_features_on_other_distributions>
<http://wiki.laptop.org/go/Keyboard_shortcuts>
and several other pages, but mysteries remain.

pgf at laptop.org usefully responded:

>> I have zero clue where to find the keymapping 
>> file or configuration utility.
> 
> i just booted ubuntu to see how they do it -- turns out it's easy.
> they use a program called "xbindkeys" to bind all of the "special" XO
> keys.  the configuration for that is in /home/olpc/.xbindkeysrc -- you'll
> see an entry in there that invokes /usr/bin/rotate_screen.py.

I added this to 
<http://wiki.laptop.org/go/Enabling_XO_features_on_other_distributions> 
Folks, this is the page where distros note their tweaks for the benefit 
of humanity.

I think Sugar doesn't use that technique.  The same page points to 
<http://dev.laptop.org/git?p=sugar;a=blob;f=src/jarabe/view/keyhandler.py;hb=HEAD> 
, but what hooks this code to keyboard events?

BTW, keyhandler.py also lists some nifty undocumented equivalents for 
some of the XO's buttons and keys:
   # the following are intended for emulator users
     '<alt><shift>f'  : 'frame',
     '<alt><shift>q'  : 'quit_emulator',
     '<alt><shift>o'  : 'open_search',
     '<alt><shift>r'  : 'rotate',
     '<alt><shift>s'  : 'say_text'
and indeed, <alt><shift>f/o/r work on my XO in 8.2.0.  I couldn't find 
any documentation for these, so I added them to the table in 
http://wiki.laptop.org/go/Keyboard_shortcuts and mentioned them in 
http://wiki.laptop.org/go/Emulating_the_XO/Help_and_tips#How_to

Tomeu wrote
> It's sugar who listens for the keycode 0xEB and asks xrandr to rotate
> the screen.

According to 
http://wiki.laptop.org/go/Ec_specification#KeyCodes_for_Buttons , the 
keycode for rotate are make=0x69, break=0xE9.  How do these become 0xEB?

I tried all the xkb* command-line programs to find the keymap, it seems that
   xmodmap -pk
shows it.  But it doesn't show anything relevant to the special buttons 
around the screen, I guess because they aren't part of the keyboard itself.

The olpc keyboard mappings in /usr/share/X11/xkb/*/olpc do map several 
XO keys to keysyms, e.g.
   key <I147> { [ XF86TaskPane ] }; // frame key (the top-right key)

but I think Sugar doesn't use the keysym, it looks directly for the key 
or its keystroke equivalent.  It seems the olpc X11 keyboard mappings 
are to make the XO-1's keys mean something when running other desktop 
environments than Sugar.

Keyboard handling is spread across lots of subsystems and pages, I'll 
improve them with any information I receive.

--
=S



More information about the Devel mailing list