[Sugar-devel] [PATCH] Record: stop recording with the same shutter key in gamepad

Manuel Quiñones manuq at laptop.org
Mon Mar 12 16:02:10 EDT 2012


Use the same shutter key in gamepad to stop the recording.

This is for bug #3360 .

Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
 record.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/record.py b/record.py
index 5c06f20..6ec9fcf 100644
--- a/record.py
+++ b/record.py
@@ -238,11 +238,18 @@ class Record(activity.Activity):
         self._toolbar_controls.set_quality(data.get('quality', 0))
 
     def _key_pressed(self, widget, event):
-        if self.model.ui_frozen():
-            return False
-
         key = event.keyval
 
+        if self.model.ui_frozen():
+            # game key O stops if recording:
+            if self.model.get_state() == constants.STATE_RECORDING:
+                if key == gtk.keysyms.KP_Page_Up:
+                    if self._shutter_button.props.visible:
+                        if self._shutter_button.props.sensitive:
+                            self._shutter_button.clicked()
+            else:
+                return False
+
         if key == gtk.keysyms.KP_Page_Up: # game key O
             if self._shutter_button.props.visible:
                 if self._shutter_button.props.sensitive:
-- 
1.7.7.6



More information about the Sugar-devel mailing list