diff --git a/NEWS b/NEWS index 7ca9e7dc..13a4fbae 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* Associate ctrl+s to keep. (rwh) + Snapshot 73cae198f5 * Remove the startup sound for now, to not break audio diff --git a/lib/sugar/activity/activity.py b/lib/sugar/activity/activity.py index d218f08e..7c095c5a 100644 --- a/lib/sugar/activity/activity.py +++ b/lib/sugar/activity/activity.py @@ -408,6 +408,7 @@ class Activity(Window, gtk.Container): self.connect('realize', self.__realize_cb) self.connect('delete-event', self.__delete_event_cb) + self.connect("key_press_event", self.__key_press_event_cb) self._active = False self._activity_id = handle.activity_id @@ -850,6 +851,13 @@ class Activity(Window, gtk.Container): metadata = property(get_metadata, None) + def __key_press_event_cb(self, widget, event): + key = gtk.gdk.keyval_name(event.keyval) + if key == 's' and (event.state & gtk.gdk.CONTROL_MASK): + logging.debug('Keep requested') + self.copy() + return True + def get_bundle_name(): """Return the bundle name for the current process' bundle""" return os.environ['SUGAR_BUNDLE_NAME']