Ticket #3360: 0001-Record-stop-recording-with-the-same-shutter-key-in-g.patch

File 0001-Record-stop-recording-with-the-same-shutter-key-in-g.patch, 1.5 KB (added by manuq, 12 years ago)
  • record.py

    From dfd8004c6a102a8ad841cdbb14a95630f0fb6ca0 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Mon, 12 Mar 2012 16:54:43 -0300
    Subject: [PATCH] Record: stop recording with the same shutter key in gamepad
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    Use the same shutter key in gamepad to stop the recording.
    
    This is for bug #3360 .
    
    Signed-off-by: Manuel Quiñones <manuq@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 b class Record(activity.Activity): 
    238238        self._toolbar_controls.set_quality(data.get('quality', 0))
    239239
    240240    def _key_pressed(self, widget, event):
    241         if self.model.ui_frozen():
    242             return False
    243 
    244241        key = event.keyval
    245242
     243        if self.model.ui_frozen():
     244            # game key O stops if recording:
     245            if self.model.get_state() == constants.STATE_RECORDING:
     246                if key == gtk.keysyms.KP_Page_Up:
     247                    if self._shutter_button.props.visible:
     248                        if self._shutter_button.props.sensitive:
     249                            self._shutter_button.clicked()
     250            else:
     251                return False
     252
    246253        if key == gtk.keysyms.KP_Page_Up: # game key O
    247254            if self._shutter_button.props.visible:
    248255                if self._shutter_button.props.sensitive: