[gedit-plugins] Bug 610978 - Allow using normal keyboard shortcuts in terminal plugin



commit 43cdee439ac560263fb96b1cce306dc3ba6e49b3
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 e99e900..f655cb6 100644
--- a/plugins/terminal/terminal.py
+++ b/plugins/terminal/terminal.py
@@ -225,7 +225,18 @@ class GeditTerminalPanel(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]