Don't require any particular key modifier state in full screen view
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 2 Dec 2007 21:45:46 +0000 (22:45 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 2 Dec 2007 21:45:46 +0000 (22:45 +0100)
A check was introduced in 7e49123d2e84, but I can't understand why. The
current code (before this change) didn't work with NumLock on, and it
seems to work without any check of event.state.

src/packages/kofoto/gkofoto/fullscreenwindow.py

index ca2d511..50d24e7 100644 (file)
@@ -122,34 +122,33 @@ class FullScreenWindow(gtk.Window):
 
     def _key_press_event_cb(self, unused, event):
         k = gtk.keysyms
-        if event.state in [0, gtk.gdk.SHIFT_MASK, gtk.gdk.CONTROL_MASK]:
-            if event.keyval in [k.space, k.Right, k.Down, k.Page_Down]:
-                self._goto(self._current_index + 1)
-                return True
-            if event.keyval in [k.BackSpace, k.Left, k.Up, k.Page_Up]:
-                self._goto(self._current_index - 1)
-                return True
-            if event.keyval == k.Home:
-                self._goto(0)
-                return True
-            if event.keyval == k.End:
-                self._goto(len(self._image_versions) - 1)
-                return True
-            if event.keyval == k.Escape:
-                self.destroy()
-                return True
-            if event.keyval == k.plus:
-                self._image_view.zoom_in()
-                return True
-            if event.keyval == k.minus:
-                self._image_view.zoom_out()
-                return True
-            if event.keyval == k._0:
-                self._image_view.zoom_to_actual()
-                return True
-            if event.keyval == k.equal:
-                self._image_view.zoom_to_fit()
-                return True
+        if event.keyval in [k.space, k.Right, k.Down, k.Page_Down]:
+            self._goto(self._current_index + 1)
+            return True
+        if event.keyval in [k.BackSpace, k.Left, k.Up, k.Page_Up]:
+            self._goto(self._current_index - 1)
+            return True
+        if event.keyval == k.Home:
+            self._goto(0)
+            return True
+        if event.keyval == k.End:
+            self._goto(len(self._image_versions) - 1)
+            return True
+        if event.keyval == k.Escape:
+            self.destroy()
+            return True
+        if event.keyval == k.plus:
+            self._image_view.zoom_in()
+            return True
+        if event.keyval == k.minus:
+            self._image_view.zoom_out()
+            return True
+        if event.keyval == k._0:
+            self._image_view.zoom_to_actual()
+            return True
+        if event.keyval == k.equal:
+            self._image_view.zoom_to_fit()
+            return True
         return False
 
     def _maybe_cancel_load(self):