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

Richard Hughes hughsient at gmail.com
Mon Jun 4 07:56:34 PDT 2007


On Mon, 2007-06-04 at 10:33 -0400, David Zeuthen wrote:
> Hi,
> 
> Richard Hughes wrote:
> > What about the attached? (untested)
> > 
> > +# Should we try to remap keys? (makes random multimedia keys work)
> > +AC_ARG_ENABLE(keymaps, [  --enable-keymaps            Remap multimedia keys],enable_keymaps=$enableval,enable_keymaps=yes)
> > +AM_CONDITIONAL(BUILD_KEYMAPS, test x$enable_keymaps == xyes)
> > +msg_keymaps=no
> > +if test "x$enable_keymaps" != "xno"; then
> > +   msg_keymaps=yes
> > +fi
> > +
> 
> Should probably only default to msg_keymaps=yes on Linux.

Yup.

> > +	/* get a file descriptor to the console */
> > +	fd = evdev_open (device);
> > +	if (fd < 0) {
> > +		printf ("hal-setup-keymap: Could not get console");
> > +		return 1;
> > +	}
> 
> The comment and error message seems wrong here.

Yup.

> > +    <match key="info.product" string="AT Translated Set 2 keyboard">
> 
> First, this should be input.product rather than info.product. Second, 
> it's still a bit ugly.. I wonder if there's a better way of identifying 
> keyboards hard-wired to the machine. Maybe (untested) check if
> 
> <match key="@input.originating_device:info.linux.driver" string="atkbd">

Yes, seems a good idea, and a bit less fragile.

> Of course, for systems with USB keyboards this won't work but I think 
> that's fine; we can check other things that way.

Indeed.

> > +    <!-- These are buttons synthesized in kernel drivers -->
> > +    <match key="info.product" string="ThinkPad Extra Buttons">
> 
> Also s/info./input./. If there's any specific kernel version you need, 
> it would be good to mention too.

Well, a very new kernel! The thinkpad stuff is currently unreleased, but
will be pushed upstream when the merge window reopens.

> I think Lennart had some more comments as well.

Sure, I'll continue from his mail and attach the patches there.

Richard.




More information about the hal mailing list