diff options
author | infirit <[email protected]> | 2014-11-02 15:04:36 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-11-02 17:43:10 +0100 |
commit | b8e3a26d0975cb43cb5a315bceaf581f6ea2a5a8 (patch) | |
tree | ec0df37035271d681b220c966bcafc8d5943ba90 /plugins/media-keys/msd-media-keys-manager.c | |
parent | af56e3974762769171f51378fde8cb63da5db1fd (diff) | |
download | mate-settings-daemon-b8e3a26d0975cb43cb5a315bceaf581f6ea2a5a8.tar.bz2 mate-settings-daemon-b8e3a26d0975cb43cb5a315bceaf581f6ea2a5a8.tar.xz |
a11y-keybindings: Move to media-keys plugin
Diffstat (limited to 'plugins/media-keys/msd-media-keys-manager.c')
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 39 |
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 (); } |