Skip to content
Permalink
Browse files

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 <zhang.xianwei8@zte.com.cn>
  • Loading branch information...
zhangxianwei8 authored and raveit65 committed Sep 29, 2018
1 parent b761b23 commit 193f3fbc64a1690f2d4392833b9591832bc29377
Showing with 19 additions and 0 deletions.
  1. +4 −0 plugins/media-keys/acme.h
  2. +15 −0 plugins/media-keys/msd-media-keys-manager.c
@@ -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 },
@@ -585,6 +585,15 @@ do_eject_action (MsdMediaKeysManager *manager)
g_object_unref (fav_drive);
}

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)
{
@@ -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:

0 comments on commit 193f3fb

Please sign in to comment.
You can’t perform that action at this time.