[gnome-settings-daemon] media-keys: Add support for XF86TouchpadOn/Off
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] media-keys: Add support for XF86TouchpadOn/Off
- Date: Fri, 19 Nov 2010 00:02:29 +0000 (UTC)
commit 1c8f64d1dc6beb7d27a6dce74fa29e27e8c34583
Author: Bastien Nocera <hadess hadess net>
Date: Mon Nov 1 19:04:30 2010 +0000
media-keys: Add support for XF86TouchpadOn/Off
Using hard-coded keys.
This requires new keycodes added to X.org in:
https://bugs.freedesktop.org/show_bug.cgi?id=31300
https://bugzilla.gnome.org/show_bug.cgi?id=633726
plugins/media-keys/acme.h | 4 ++++
plugins/media-keys/gsd-media-keys-manager.c | 16 ++++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/plugins/media-keys/acme.h b/plugins/media-keys/acme.h
index c6ac917..27b4165 100644
--- a/plugins/media-keys/acme.h
+++ b/plugins/media-keys/acme.h
@@ -27,6 +27,8 @@
enum {
TOUCHPAD_KEY,
+ TOUCHPAD_ON_KEY,
+ TOUCHPAD_OFF_KEY,
MUTE_KEY,
VOLUME_DOWN_KEY,
VOLUME_UP_KEY,
@@ -65,6 +67,8 @@ static struct {
Key *key;
} keys[HANDLED_KEYS] = {
{ TOUCHPAD_KEY, "touchpad", NULL, NULL },
+ { TOUCHPAD_ON_KEY, NULL, "XF86TouchpadOn", NULL },
+ { TOUCHPAD_OFF_KEY, NULL, "XF86TouchpadOff", NULL },
{ MUTE_KEY, "volume-mute",NULL, NULL },
{ VOLUME_DOWN_KEY, "volume-down", NULL, NULL },
{ VOLUME_UP_KEY, "volume-up", NULL, NULL },
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index c4704e9..5d5ebd4 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -592,6 +592,16 @@ do_touchpad_action (GsdMediaKeysManager *manager)
g_object_unref (settings);
}
+static void
+do_touchpad_osd_action (GsdMediaKeysManager *manager, gboolean state)
+{
+ dialog_init (manager);
+ gsd_media_keys_window_set_action_custom (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
+ state ? "touchpad-enabled" : "touchpad-disabled",
+ FALSE);
+ dialog_show (manager);
+}
+
#ifdef HAVE_PULSE
static void
update_dialog (GsdMediaKeysManager *manager,
@@ -1070,6 +1080,12 @@ do_action (GsdMediaKeysManager *manager,
case TOUCHPAD_KEY:
do_touchpad_action (manager);
break;
+ case TOUCHPAD_ON_KEY:
+ do_touchpad_osd_action (manager, TRUE);
+ break;
+ case TOUCHPAD_OFF_KEY:
+ do_touchpad_osd_action (manager, FALSE);
+ break;
case MUTE_KEY:
case VOLUME_DOWN_KEY:
case VOLUME_UP_KEY:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]