1 Reply Latest reply on Mar 28, 2011 10:50 AM by Flex harUI

    KeyDown event fullscreen problem

    AhmedCogenli Level 1

      I have an application, it runs full screen, I want app closed when "0" key pressed. It works very well when the app is not FS. It works in FS when I press ALT key, then it captures the keyboard events. What should be the reason?


      Here is the code;


      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                             xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="windowedapplication1_creationCompleteHandler(event)">


                  import flash.events.KeyboardEvent;
                  import mx.events.FlexEvent;


                  protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                      showStatusBar = false;
                      this.addEventListener(KeyboardEvent.KEY_DOWN, windowedapplication1_keyDownHandler,false, 0, true );


                  protected function windowedapplication1_keyDownHandler(event:KeyboardEvent):void

                      if (event.keyCode == 96) {

                     l1.text = event.keyCode.toString();




              <!-- Place non-visual elements (e.g., services, value objects) here -->
          <s:Label id="l1" x="278" y="145" text="Label" width="146" height="45"/>