Tomeu was right. Catching the key stokes in the activity works.<br><br>From 08e0226731c13e74b993b59c1a2c8165e9ad3654 Mon Sep 17 00:00:00 2001<br>From: Gonzalo Odiard &lt;<a href="mailto:godiard@gmail.com">godiard@gmail.com</a>&gt;<br>
Date: Wed, 2 Jun 2010 01:59:54 -0300<br>Subject: [PATCH] implement OLPC #8865<br><br>---<br> Area.py            |   13 ++++++++-----<br> OficinaActivity.py |   15 +++++++++++++++<br> 2 files changed, 23 insertions(+), 5 deletions(-)<br>
<br>diff --git a/Area.py b/Area.py<br>index e81fcdc..8a5e523 100644<br>--- a/Area.py<br>+++ b/Area.py<br>@@ -97,15 +97,13 @@ class Area(gtk.DrawingArea):<br>                 gtk.gdk.BUTTON_PRESS_MASK |<br>                 gtk.gdk.BUTTON_RELEASE_MASK|<br>
                 gtk.gdk.EXPOSURE_MASK |<br>-                gtk.gdk.KEY_PRESS_MASK |<br>-                gtk.gdk.KEY_RELEASE_MASK) <br>+                gtk.gdk.KEY_PRESS_MASK) <br>                 <br>         self.connect(&quot;expose_event&quot;,self.expose)<br>
         self.connect(&quot;motion_notify_event&quot;, self.mousemove)<br>         self.connect(&quot;button_press_event&quot;, self.mousedown)<br>         self.connect(&quot;button_release_event&quot;, self.mouseup)<br>         self.connect(&quot;key_press_event&quot;, self.key_press)<br>
-        self.connect(&quot;key_release_event&quot;, self.key_release)<br> <br>         self.set_flags(gtk.CAN_FOCUS)<br>         self.grab_focus()<br>@@ -1163,8 +1161,13 @@ class Area(gtk.DrawingArea):<br>                 self.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.TCROSS))<br>
             widget.queue_draw()<br> <br>-    def key_release(self,widget,event):<br>-        pass<br>+    def change_line_size(self, delta):<br>+        if self.tool[&#39;name&#39;] in [&#39;pencil&#39;,&#39;eraser&#39;,&#39;brush&#39;,&#39;rainbow&#39;]:<br>
+            size = self.tool[&#39;line size&#39;] + delta<br>+            self.tool[&#39;line size&#39;] = size<br>+            self.configure_line(size)<br>+            self.queue_draw()<br>+<br> <br>     def _keep_selection_ratio(self, coords):<br>
         def sign(x):<br>diff --git a/OficinaActivity.py b/OficinaActivity.py<br>index f7dd088..8259ca8 100644<br>--- a/OficinaActivity.py<br>+++ b/OficinaActivity.py<br>@@ -116,6 +116,8 @@ class OficinaActivity(activity.Activity):<br>
         self.set_toolbox(toolbox)<br>         toolbox.show()<br> <br>+        self.connect(&quot;key_press_event&quot;, self.key_press)<br>+<br>         # setup self.area only once<br> <br>         def map_cp(widget):<br>
@@ -130,6 +132,19 @@ class OficinaActivity(activity.Activity):<br> <br>         self._setup_handle = self.connect(&#39;map&#39;, map_cp)<br> <br>+<br>+    def key_press(self,widget,event):<br>+        if (event.keyval &gt;= 65474) and (event.keyval &lt;= 65477):<br>
+            if event.keyval == 65474:<br>+                self.area.change_line_size(-5)<br>+            elif event.keyval == 65475:<br>+                self.area.change_line_size(-1)<br>+            elif event.keyval == 65476:<br>
+                self.area.change_line_size(1)<br>+            elif event.keyval == 65477:<br>+                self.area.change_line_size(5)<br>+<br>+<br>     def read_file(self, file_path):<br>         &#39;&#39;&#39;Read file from Sugar Journal.&#39;&#39;&#39;<br>
 <br>-- <br>1.6.6.1<br><br clear="all"><br>-- <br>Gonzalo<br>