Have addon-keyboard recognize some more buttons

Sjoerd Simons sjoerd at luon.net
Sun Mar 5 12:52:37 PST 2006


On Wed, Mar 01, 2006 at 03:53:48PM +0000, Matthew Garrett wrote:
> On Wed, Mar 01, 2006 at 03:56:12PM +0100, Sjoerd Simons wrote:
> > > 	[KEY_POWER] = "power",
> > > 	[KEY_MUTE] = "mute",
> > > 	[KEY_VOLUMEDOWN] = "volumedown",
> > > 	[KEY_VOLUMEUP] = "volumeup",
> > > 	[KEY_KBDILLUMTOGGLE] = "kbdillumtoggle",
> > > 	[KEY_KBDILLUMDOWN] = "kbdillumdown",
> > > 	[KEY_KBDILLUMUP] = "kbdillumup",
> > > 	[KEY_SWITCHVIDEOMODE] = "switchvideomode"
> 
> These require a newer linux/input.h than many people are shipping, which 
> may be a problem. Possibly we should include our own?

I've updated my patch to use the new convention. Also it optionally defines
some of the newer keys for those who have a too old input.h file.

  Sjoerd
-- 
Nonsense and beauty have close connections.
		-- E. M. Forster
-------------- next part --------------
Index: hald/linux2/addons/addon-keyboard.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-keyboard.c,v
retrieving revision 1.5
diff -u -r1.5 addon-keyboard.c
--- hald/linux2/addons/addon-keyboard.c	3 Mar 2006 17:33:26 -0000	1.5
+++ hald/linux2/addons/addon-keyboard.c	5 Mar 2006 20:40:04 -0000
@@ -138,7 +138,26 @@
 	[KEY_BRIGHTNESSDOWN] = "brightness-down",
 	[KEY_BRIGHTNESSUP] = "brightness-up",
 	[KEY_MEDIA] = "media",
-	[KEY_POWER] = "power"
+	[KEY_POWER] = "power",
+	[KEY_MUTE] = "mute",
+	[KEY_VOLUMEDOWN] = "volume-down",
+	[KEY_VOLUMEUP] = "volume-up",
+#ifndef KEY_SWITCHVIDEOMODE
+#define KEY_SWITCHVIDEOMODE	227
+#endif
+	[KEY_SWITCHVIDEOMODE] = "switch-videomode"
+#ifndef KEY_KBDILLUMTOGGLE
+#define KEY_KBDILLUMTOGGLE	228
+#endif
+	[KEY_KBDILLUMTOGGLE] = "kbd-illum-toggle",
+#ifndef KEY_KBDILLUMDOWN
+#define KEY_KBDILLUMDOWN	229
+#endif
+	[KEY_KBDILLUMDOWN] = "kbd-illum-down",
+#ifndef KEY_KBDILLUMUP
+#define KEY_KBDILLUMUP		230
+#endif
+	[KEY_KBDILLUMUP] = "kbd-illum-up"
 };
 
 static void


More information about the hal mailing list