summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorZhang Xianwei <[email protected]>2018-09-29 15:44:57 +0800
committerraveit65 <[email protected]>2018-10-01 11:05:15 +0200
commit193f3fbc64a1690f2d4392833b9591832bc29377 (patch)
tree1d9e3f8f3ba563c75ba42b64b482c505c3cc0e5a /plugins
parentb761b23f64644122db4a3a57a831e7183e17b340 (diff)
downloadmate-settings-daemon-193f3fbc64a1690f2d4392833b9591832bc29377.tar.bz2
mate-settings-daemon-193f3fbc64a1690f2d4392833b9591832bc29377.tar.xz
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 Signed-off-by: Zhang Xianwei <[email protected]>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/media-keys/acme.h4
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c15
2 files changed, 19 insertions, 0 deletions
diff --git a/plugins/media-keys/acme.h b/plugins/media-keys/acme.h
index a1cc5c1..be277ed 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,
@@ -63,6 +65,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/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index 3a7a4e6..fbca896 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -586,6 +586,15 @@ do_eject_action (MsdMediaKeysManager *manager)
}
static void
+do_touchpad_osd_action (MsdMediaKeysManager *manager, gboolean state)
+{
+ dialog_init (manager);
+ msd_media_keys_window_set_action_custom (MSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
+ state ? "touchpad-enabled" : "touchpad-disabled",
+ FALSE);
+ dialog_show (manager);
+}
+static void
do_touchpad_action (MsdMediaKeysManager *manager)
{
GSettings *settings = g_settings_new (TOUCHPAD_SCHEMA);
@@ -930,6 +939,12 @@ do_action (MsdMediaKeysManager *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: