title: Spark WindowedApplication, monitor keyUp event
body: <p>I have a WindowedApplication, I need to monitor a <code>keyUp</code> so that I can close the application on the escape key pressed. However, my code is not working:</p>
  
  <pre><code>&lt;s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                         xmlns:s="library://ns.adobe.com/flex/spark" 
                         xmlns:mx="library://ns.adobe.com/flex/mx"
                         keyUp="windowedapplication1_keyUpHandler(event)"&gt;
  
  &lt;fx:Script&gt;
          &lt;![CDATA[   
  
              protected function windowedapplication1_keyUpHandler(event:KeyboardEvent):void
              {
                  //Monitor key press {ESC}
                  if(event.keyCode == 27){
                      exit();
                  }
                  else{
                      trace("key = " + event.keyCode);
                  }
              }   
  
          ]]&gt;
  &lt;/fx:Script&gt;
  </code></pre>
  
  <p>It seems that this event is not firing at all, I've even tried to override the <code>keyUpHandler</code> and trace out some info, but nothing.</p>