[gnome-settings-daemon] media-keys: add more keyboard shortcuts for screenshots



commit 4709c0e0c02145599d7e2c3f29c2ae8191eacd93
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jan 25 23:28:30 2012 -0500

    media-keys: add more keyboard shortcuts for screenshots
    
    Add a keyboard shortcut for taking a screenshot of an area, and other
    three items for clipboard actions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=652489

 ...ngs-daemon.plugins.media-keys.gschema.xml.in.in |   20 ++++++++++++++++++++
 plugins/media-keys/gsd-media-keys-manager.c        |   12 ++++++++++++
 plugins/media-keys/shortcuts-list.h                |    8 ++++++++
 3 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
index e58239e..6a63236 100644
--- a/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
@@ -110,6 +110,26 @@
       <_summary>Take a screenshot of a window</_summary>
       <_description>Binding to take a screenshot of a window.</_description>
     </key>
+    <key name="area-screenshot" type="s">
+      <default>'&lt;Shift&gt;Print'</default>
+      <_summary>Take a screenshot of an area</_summary>
+      <_description>Binding to take a screenshot of an area.</_description>
+    </key>
+    <key name="screenshot-clip" type="s">
+      <default>'&lt;Ctrl&gt;Print'</default>
+      <_summary>Copy a screenshot to clipboard</_summary>
+      <_description>Binding to copy a screenshot to clipboard.</_description>
+    </key>
+    <key name="window-screenshot-clip" type="s">
+      <default>'&lt;Ctrl&gt;&lt;Alt&gt;Print'</default>
+      <_summary>Copy a screenshot of a window to clipboard</_summary>
+      <_description>Binding to copy a screenshot of a window to clipboard.</_description>
+    </key>
+    <key name="area-screenshot-clip" type="s">
+      <default>'&lt;Ctrl&gt;&lt;Shift&gt;Print'</default>
+      <_summary>Copy a screenshot of an area to clipboard</_summary>
+      <_description>Binding to copy a screenshot of an area to clipboard.</_description>
+    </key>
     <key name="www" type="s">
       <default>'XF86WWW'</default>
       <_summary>Launch web browser</_summary>
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 51053ea..8a2de13 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -1808,6 +1808,18 @@ do_action (GsdMediaKeysManager *manager,
         case WINDOW_SCREENSHOT_KEY:
                 execute (manager, "gnome-screenshot --window", FALSE);
                 break;
+        case AREA_SCREENSHOT_KEY:
+                execute (manager, "gnome-screenshot --area", FALSE);
+                break;
+        case SCREENSHOT_CLIP_KEY:
+                execute (manager, "gnome-screenshot --clipboard", FALSE);
+                break;
+        case WINDOW_SCREENSHOT_CLIP_KEY:
+                execute (manager, "gnome-screenshot --window --clipboard", FALSE);
+                break;
+        case AREA_SCREENSHOT_CLIP_KEY:
+                execute (manager, "gnome-screenshot --area --clipboard", FALSE);
+                break;
         case WWW_KEY:
                 do_url_action (manager, "http", timestamp);
                 break;
diff --git a/plugins/media-keys/shortcuts-list.h b/plugins/media-keys/shortcuts-list.h
index 42a0649..437ed2c 100644
--- a/plugins/media-keys/shortcuts-list.h
+++ b/plugins/media-keys/shortcuts-list.h
@@ -46,6 +46,10 @@ typedef enum {
         HELP_KEY,
         SCREENSHOT_KEY,
         WINDOW_SCREENSHOT_KEY,
+        AREA_SCREENSHOT_KEY,
+        SCREENSHOT_CLIP_KEY,
+        WINDOW_SCREENSHOT_CLIP_KEY,
+        AREA_SCREENSHOT_CLIP_KEY,
         WWW_KEY,
         PLAY_KEY,
         PAUSE_KEY,
@@ -105,6 +109,10 @@ static struct {
         { HELP_KEY, "help", NULL },
         { SCREENSHOT_KEY, "screenshot", NULL },
         { WINDOW_SCREENSHOT_KEY, "window-screenshot", NULL },
+        { AREA_SCREENSHOT_KEY, "area-screenshot", NULL },
+        { SCREENSHOT_CLIP_KEY, "screenshot-clip", NULL },
+        { WINDOW_SCREENSHOT_CLIP_KEY, "window-screenshot-clip", NULL },
+        { AREA_SCREENSHOT_CLIP_KEY, "area-screenshot-clip", NULL },
         { WWW_KEY, "www", NULL },
         { PLAY_KEY, "play", NULL },
         { PAUSE_KEY, "pause", NULL },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]