[gedit-plugins/gnome-3-8] Bug 610978 - Allow using normal keyboard shortcuts in terminal plugin



commit fcec2df685861182cb5b8ea8b14a15917bc1a077
Author: Garrett Regier <garrettregier gmail com>
Date:   Sat Jun 29 15:15:33 2013 -0700

    Bug 610978 - Allow using normal keyboard shortcuts in terminal plugin

 plugins/terminal/terminal.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/plugins/terminal/terminal.py b/plugins/terminal/terminal.py
index cce0b04..fd48e32 100644
--- a/plugins/terminal/terminal.py
+++ b/plugins/terminal/terminal.py
@@ -204,7 +204,18 @@ class GeditTerminal(Gtk.Box):
                 self._accels[name][2]()
                 return True
 
-        return False
+        keyval_name = Gdk.keyval_name(Gdk.keyval_to_upper(event.keyval))
+
+        # Special case some Vte.Terminal shortcuts
+        # so the global shortcuts do not override them
+        if modifiers == Gdk.ModifierType.CONTROL_MASK and keyval_name in 'ACDEHKLRTUWZ':
+            return False
+
+        if modifiers == Gdk.ModifierType.MOD1_MASK and keyval_name in 'BF':
+            return False
+
+        return Gtk.accel_groups_activate(self.get_toplevel(),
+                                         event.keyval, modifiers)
 
     def on_vte_button_press(self, term, event):
         if event.button == 3:


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