From 723f821493aeedac089d1905b3d5487b0968c5b7 Mon Sep 17 00:00:00 2001 From: infirit Date: Sat, 13 Dec 2014 17:00:08 +0100 Subject: media-keys: Add support for more multimedia keys Add support for FastForward, Rewind, Repeat and Shuffle multimedia keys. Taken from GSD commits: 338a2db55d96304ebeedcb3e6f87b88ffa3b7828 b4cb0dc3c936336ffba65c50f737cffe9bf79cbe From: Bastien Nocera Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=539915 --- plugins/media-keys/acme.h | 9 +++++++++ plugins/media-keys/msd-media-keys-manager.c | 13 ++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'plugins/media-keys') diff --git a/plugins/media-keys/acme.h b/plugins/media-keys/acme.h index e7fddf7..7c9013c 100644 --- a/plugins/media-keys/acme.h +++ b/plugins/media-keys/acme.h @@ -45,6 +45,10 @@ enum { STOP_KEY, PREVIOUS_KEY, NEXT_KEY, + REWIND_KEY, + FORWARD_KEY, + REPEAT_KEY, + RANDOM_KEY, MAGNIFIER_KEY, SCREENREADER_KEY, ON_SCREEN_KEYBOARD_KEY, @@ -76,6 +80,11 @@ static struct { { STOP_KEY, "stop", NULL, NULL }, { PREVIOUS_KEY, "previous", NULL, NULL }, { NEXT_KEY, "next", NULL, NULL }, + /* Those are not configurable in the UI */ + { REWIND_KEY, NULL, "XF86AudioRewind", NULL }, + { FORWARD_KEY, NULL, "XF86AudioForward", NULL }, + { REPEAT_KEY, NULL, "XF86AudioRepeat", NULL }, + { RANDOM_KEY, NULL, "XF86AudioRandomPlay", NULL}, { MAGNIFIER_KEY, "magnifier", NULL, NULL }, { SCREENREADER_KEY, "screenreader", NULL, NULL }, { ON_SCREEN_KEYBOARD_KEY, "on-screen-keyboard", NULL, NULL }, diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c index 0680818..e37b723 100644 --- a/plugins/media-keys/msd-media-keys-manager.c +++ b/plugins/media-keys/msd-media-keys-manager.c @@ -1000,19 +1000,22 @@ do_action (MsdMediaKeysManager *manager, break; case PLAY_KEY: return do_multimedia_player_action (manager, "Play"); - break; case PAUSE_KEY: return do_multimedia_player_action (manager, "Pause"); - break; case STOP_KEY: return do_multimedia_player_action (manager, "Stop"); - break; case PREVIOUS_KEY: return do_multimedia_player_action (manager, "Previous"); - break; case NEXT_KEY: return do_multimedia_player_action (manager, "Next"); - break; + case REWIND_KEY: + return do_multimedia_player_action (manager, "Rewind"); + case FORWARD_KEY: + return do_multimedia_player_action (manager, "FastForward"); + case REPEAT_KEY: + return do_multimedia_player_action (manager, "Repeat"); + case RANDOM_KEY: + return do_multimedia_player_action (manager, "Shuffle"); case MAGNIFIER_KEY: do_magnifier_action (manager); break; -- cgit v1.2.1