Code

add some obligatory shortcuts
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 26 Feb 2007 17:46:38 +0000 (17:46 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 26 Feb 2007 17:46:38 +0000 (17:46 +0000)
src/flood-context.cpp

index 7cb0b15f631bcf878153ec54644aada693f486b3..46e7cbb91fae81a90442019c7c9ce88514639a21 100644 (file)
@@ -528,6 +528,8 @@ static gint sp_flood_context_item_handler(SPEventContext *event_context, SPItem
 
 static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEvent *event)
 {
+    SPDesktop *desktop = event_context->desktop;
+
     gint ret = FALSE;
     switch (event->type) {
     case GDK_BUTTON_PRESS:
@@ -537,6 +539,22 @@ static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEven
             ret = TRUE;
         }
         break;
+    case GDK_KEY_PRESS:
+        switch (get_group0_keyval (&event->key)) {
+        case GDK_Up:
+        case GDK_Down:
+        case GDK_KP_Up:
+        case GDK_KP_Down:
+            // prevent the zoom field from activation
+            if (!MOD__CTRL_ONLY)
+                ret = TRUE;
+            break;
+        case GDK_Escape:
+            sp_desktop_selection(desktop)->clear();
+        default:
+            break;
+        }
+        break;
     default:
         break;
     }