[PATCH x11proto] Add XF86XK_TouchpadOn/Off

Peter Hutterer peter.hutterer at who-t.net
Sun Nov 7 21:24:55 PST 2010


From: Bastien Nocera <hadess at hadess.net>

Those keysyms will be used to report events from the hardware. Hardware
like the HP laptops emit 2 separate keycodes when the touchpad is enabled
or disabled. So we can catch those in user-space and display a popup.

https://bugs.freedesktop.org/show_bug.cgi?id=31300
---
Tricky situation, mostly my fault. I added XF86XK_TouchpadToggle a year or
so ago to the XF86keysym database. That probably shouldn't have happened,
but given it's already in, adding those two here instead of keysymdef.h
seems to be the better thing to do.

As Bastien points out elsewhere [1]
"In GNOME 2.32, we added support for touchpad toggle buttons, by
capturing the XF86TouchpadToggle button in gnome-settings-daemon,
showing a nice popup, and disabling the touchpad in software.

That works great for a number of laptops, but completely breaks a number
of others where the hardware handles the request, but still sends a key
event (usually separate ones for on and off). In those cases, we'd need
2 more key types, in the kernel, and in X.org."

[1] http://lists.freedesktop.org/archives/xorg/2010-November/051727.html

Patch is fine with me. any NAKs?

The udev patch to standardise the behaviour is already in, see
http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=a1ca5f60e0770299c5c5f21bd371f5823802412b
It requires an update to xkeyboard-config as well, synchronised with udev to
maintain consistency. That's possible once this change is in.

Cheers,
  Peter

 XF86keysym.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/XF86keysym.h b/XF86keysym.h
index 200f5c1..fd3af4f 100644
--- a/XF86keysym.h
+++ b/XF86keysym.h
@@ -207,6 +207,8 @@
 #define XF86XK_Suspend		0x1008FFA7   /* Sleep to RAM                */
 #define XF86XK_Hibernate	0x1008FFA8   /* Sleep to disk               */
 #define XF86XK_TouchpadToggle	0x1008FFA9   /* Toggle between touchpad/trackstick */
+#define XF86XK_TouchpadOn	0x1008FFB0   /* The touchpad got switched on */
+#define XF86XK_TouchpadOff	0x1008FFB1   /* The touchpad got switched off */
 
 /* Keys for special action keys (hot keys) */
 /* Virtual terminals on some operating systems */
-- 
1.7.3.1


More information about the xorg-devel mailing list