1 Reply Latest reply on Sep 17, 2010 8:18 PM by Mark Robbins 312

    Disable ESC in Fullscreen in AIR application

    Ibarim Level 1

      Hi,

       

      I would like to remove default air behaviour that it's resizing down after hitting ESC button. I red that this is possible with 'preventDefault();' method, but it seems not to work. My code below:

       

       

      private function init():void {
      
           stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
           stage.addEventListener(KeyboardEvent.KEY_DOWN, ifEsc);
      
      }
      
      private function ifEsc(e:KeyboardEvent):void {
         if (e.keyCode == Keyboard.ESCAPE) { 
         e.preventDefault();
      }
      
      

       

      Anyone had simmilar problems?

        • 1. Re: Disable ESC in Fullscreen in AIR application
          Mark Robbins 312

                public function eend(e:Event):void{
                  e.preventDefault();
                  e.stopPropagation();
                  e.stopImmediatePropagation();
                  ;
                }

           

           

          private var winDisplayStateTimer:Timer;

          /// put lines below in some initializer
                winDisplayStateTimer=new Timer(0);
                winDisplayStateTimer.delay=2000;
                winDisplayStateTimer.addEventListener(TimerEvent.TIMER,onWinDisplayStateTimerTick);
                winDisplayStateTimer.start();
          /////////////////////////////////////////

                 private function onWinDisplayStateTimerTick(evt:TimerEvent):void{
                   if (stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE) {
                     stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
                   }