[Sugar-devel] behaviour of F-keys on XO HS
pgf at laptop.org
Tue Jul 20 09:10:38 EDT 2010
> On Tue, Jul 20, 2010 at 01:04:06AM -0400, Raul Gutierrez Segales wrote:
> > On Mon, 2010-07-19 at 21:33 -0400, Walter Bender wrote:
> > > On Mon, Jul 19, 2010 at 9:27 PM, Gonzalo Odiard <godiard at gmail.com> wrote:
> > > > Yeah
> > > > How we detect what keyboard is present?
> > http://wiki.laptop.org/go/OLPC_Firmware_q3a44 mentions:
> > 1889: OLPC keyboard driver, avoid confusing EC with enable scan command
> That's unrelated, I think.
yes. the keyboards are indistinguishable electrically, without user
> > I wonder if somehow the type of detected keyboard is discoverable
> > via /ofw.
> The manufacturing data may help to narrow the possibilities, but they
> would have to be maintained correctly in conjunction with any keyboard
> changes by deployment repair.
> Perhaps someone else knows more.
right. when the laptops are build, the included keyboard is
identified with a specific tag. specifically, the KM tag is
"olpcm" for the mechanical keyboard, and "olpc" for the membrane
keyboards. however, someday it will be possible to swap between
membrane and mechanical keyboards (it isn't yet), and that will
raise a new identification issue.
i suspect we'll end up with a user utility of some sort to
correctly identify the keyboard to the system. the upper
right-hand key, for instance, is unique on each, so asking the
user to hit that will be sufficient. the utility will then
rewrite the mfg tag (doubtful) or modify the filesystem (more
likely) to record the identification.
further background: the KM mfg tag is used by
/etc/init.d/olpc-configure to set up the XKB_MODEL variable
assignment in /etc/sysconfig/keyboard (this happens just once
per software install). when the user session starts,
olpc-session sources /etc/sysconfig/keyboard, and passes the
XKB_MODEL value to setxkbmap.
setxkbmap can in turn be queried to find out what keyboard model
(and layout and variant) is in use. i suspect that this is the
mechanism that applications should use to detect which keyboard
they have, because it's xkb that has to have the right answer in
order for all the characters to work correctly. i don't know if
there's a programming API lurking under the covers in
"setxkbmap -print", or not.
paul fox, pgf at laptop.org
More information about the Devel