Commits

nakamura  committed af3009f

make Ctrl + Alt + s toggle sync mode

  • Participants
  • Parent commits 068b005

Comments (0)

Files changed (1)

 import gobject
 import os
 
+from gi.repository import Gdk
 from gi.repository import Gtk
 from gi.repository import Vte
 
                                  lambda *_: self.terminal.grab_focus())
 
         self.terminal.connect('child-exited', self.do_terminal_child_exited)
-
-        # TODO: provide keyboard shortcut to toggle sync check button
+        self.terminal.connect('key-press-event', self.do_terminal_key_press)
 
     @property
     def width(self):
 
             return True
 
+    def do_terminal_key_press(self, term, event):
+        keyname = Gdk.keyval_name(event.keyval)
+
+        if event.state == Gdk.ModifierType.CONTROL_MASK|Gdk.ModifierType.MOD1_MASK:
+            # Ctrl + Alt + ...
+            if keyname == 's':
+                self._sync_check.set_active(not self._sync_check.get_active())
+                return True
+
 
 class Config(object):
     def __init__(self, **kwargs):