#10213 HIGH 1.5-sof: Frame key doesn't work on XO-1.5 HS

Zarro Boogs per Child bugtracker at laptop.org
Wed Jul 14 12:36:47 EDT 2010


#10213: Frame key doesn't work on XO-1.5 HS
------------------------------+---------------------------------------------
           Reporter:  wad     |       Owner:  dsd                               
               Type:  defect  |      Status:  new                               
           Priority:  high    |   Milestone:  1.5-software-update               
          Component:  sugar   |     Version:  Development source as of this date
         Resolution:          |    Keywords:                                    
        Next_action:  code    |    Verified:  0                                 
Deployment_affected:          |   Blockedby:                                    
           Blocking:  10229   |  
------------------------------+---------------------------------------------

Comment(by pgf):

 the bigger topic of this bug is how to best map the top row of
 keys on the "high school" mechanical keyboard, which now has labels
 the labels for F1 through F12.

 in sugar, we want the things to work pretty much as they did
 before -- i.e., the sugar keys and the volume and brightness keys
 should ideally function without a modifier.  in order to
 accomplish this, all that needs to happen is a change to sugar to
 support F5 and F6, as mentioned in comment 1, above.

 in gnome, however, there's a desire to make all of the F-keys
 available to applications.  the sugar keys clearly aren't an
 issue (sugar isn't running), but olpc-kbdshim steals F9-F12 for
 volume and brightness.  to make those 4 keys available, we'd like
 to move volume and brightness to Fn-F9 through Fn-F12.  for
 completeness, this implies we want to enable the use of the Fn
 key with all of the F-keys (giving us another 12 useable keys).

 by default, the FN-modified F-keys generate scan codes which are already
 mapped by the kernel to generate evdev codes 466-477.  (you can
 verify this with the getkeycodes command.  don't use
 "showkey"/"showkey -s" -- it's unreliable, as per the final
 paragraph in its linux man page.)

 the default codes of 466-477 (0x1d2-0x1dd) are evdev's FN_F1 to
 FN_F12 (see /usr/include/linux/input.h), and are exactly what we
 want.  but xkb can't use those values -- the max keycode xkb can
 deal with is 248, or something like that.  so instead we'll add
 the following bindings to /etc/init.d/olpc-configure.  the values
 183 to 194 are the evdev values for F13-F24.  (it's safe to add
 these bindings for any type of OLPC keyboard, on any platform.)

 {{{
     setkeycodes e03b 183
     setkeycodes e03c 184
     setkeycodes e03d 185
     setkeycodes e03e 186
     setkeycodes e03f 187
     setkeycodes e040 188
     setkeycodes e041 189
     setkeycodes e042 190
     setkeycodes e043 191
     setkeycodes e044 192
     setkeycodes e057 193
     setkeycodes e058 194
 }}}

 then, we need to tell xkb that the <FKnn> keycodes (which xkb
 already defines in /usr/share/X11/xkb/keycodes/evdev) are
 generated from the evdev codes on our keyboard.  so we'll add
 these /usr/share/X11/xkb/symbols/olpc:

 {{{
     key <FK13> { [ F13 ] };
     key <FK14> { [ F14 ] };
     key <FK15> { [ F15 ] };
     key <FK16> { [ F16 ] };
     key <FK17> { [ F17 ] };
     key <FK18> { [ F18 ] };
     key <FK19> { [ F19 ] };
     key <FK20> { [ F20 ] };
     key <FK21> { [ F21 ] };
     key <FK22> { [ F22 ] };
     key <FK23> { [ F23 ] };
     key <FK24> { [ F24 ] };
 }}}


 finally, once all this is in place, it will be possible to modify
 olpc-kbdshim.  currently it steals F9 to F12.  we'll change that
 so that it steals F21 to F24, and doesn't steal F9 to F12 if
 sugar isn't running.  (olpc-session already has some knowledge of
 what environment is being run, and can configure olpc-kbdshim
 appropriately.)

-- 
Ticket URL: <http://dev.laptop.org/ticket/10213#comment:9>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list