summaryrefslogtreecommitdiff
path: root/plugins/media-keys/msd-media-keys-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/media-keys/msd-media-keys-manager.c')
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index 1ff0291..f0b0229 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -880,6 +880,36 @@ do_multimedia_player_action (MsdMediaKeysManager *manager,
return msd_media_player_key_pressed (manager, key);
}
+static void
+do_toggle_accessibility_key (const char *key)
+{
+ GSettings *settings;
+ gboolean state;
+
+ settings = g_settings_new ("org.mate.applications-at");
+ state = g_settings_get_boolean (settings, key);
+ g_settings_set_boolean (settings, key, !state);
+ g_object_unref (settings);
+}
+
+static void
+do_magnifier_action (MsdMediaKeysManager *manager)
+{
+ do_toggle_accessibility_key ("screen-magnifier-enabled");
+}
+
+static void
+do_screenreader_action (MsdMediaKeysManager *manager)
+{
+ do_toggle_accessibility_key ("screen-reader-enabled");
+}
+
+static void
+do_on_screen_keyboard_action (MsdMediaKeysManager *manager)
+{
+ do_toggle_accessibility_key ("screen-keyboard-enabled");
+}
+
static gboolean
do_action (MsdMediaKeysManager *manager,
int type)
@@ -969,6 +999,15 @@ do_action (MsdMediaKeysManager *manager,
case NEXT_KEY:
return do_multimedia_player_action (manager, "Next");
break;
+ case MAGNIFIER_KEY:
+ do_magnifier_action (manager);
+ break;
+ case SCREENREADER_KEY:
+ do_screenreader_action (manager);
+ break;
+ case ON_SCREEN_KEYBOARD_KEY:
+ do_on_screen_keyboard_action (manager);
+ break;
default:
g_assert_not_reached ();
}