[patch] add keymap data to make random laptop vendor keys work

Richard Hughes hughsient at gmail.com
Thu May 3 15:53:15 PDT 2007


On Thu, 2007-05-03 at 23:40 +0100, Bastien Nocera wrote:
> Hey Richard,
> 
> On Thu, 2007-05-03 at 18:45 +0100, Richard Hughes wrote:
> > Attached are two patches that make the hibernate and suspend keys work
> > on my Lenovo laptop. For other vendors, we just need to drop a new fdi
> > file into hal-info (like we do for other quirks) and the buttons should
> > just start working.
> > 
> > I've purposely not included the input.h constants (sorry Paul) as I
> > couldn't justify doing over 900 strcmp's at startup just for developers
> > when so many of us are trying to make hal start up in super quick time.
> 
> Could we at least have the xml file pre-processed? I really don't want
> to have to clean up after somebody made a typo.

You could use that argument for *any* of data in the fdi files. There's
also not much processing done - the user gets the message in dmesg, and
then chooses the correct key, we check it and then commit it.

> > Other rationale? If we whitelist the quirks for each vendor and model
> > quite specifically (like we do with video resume data) so that we don't
> > accidentally break something that's already working then we won't have
> > to change the constants. Zero pain.
> 
> Still pain of the typo...
> 
> > If this idea is approved by DavidZ, then I intend on writing a wiki page
> > on "How to get rid of the dmesg setkeycodes warning" describing the
> > steps to add an entry in hal-info. The other clear (i.e. specific)
> > entries from hotkeys-setup we can add later when all the initial patches
> > are agreed on.
> > 
> > Please review carefully. Comments and criticisms please.
> 
> Isn't it possible to avoid calling setkeycodes, and including the code
> directly in the addon?

Hmm. Perhaps. I didn't want to duplicate the code, but it may be sane in
this case. Do you know how many LOC this would be?

> Finally, before everybody goes bananas at adding keys, there's a big fat
> warning in setkeycodes:
> BUGS
>        The keycodes of X have nothing to do with those of Linux.
> Unusual keys can be made visible under Linux, but not under X.

Sure, this assumes the keys are mapped. I don't see this as a big
problem.

Cheers for the help,

Richard.



More information about the hal mailing list