Why are my KeyboardEvents not working?

 

GroundPlan is a chilc of a Canvas...

 

I also tried catching keyboard events in my Application.application but
it doesn't work neither...

 

I'm testing in Internet Explorer and my application has focus...  thx.

 

 

public class GroundPlan extends Container

{...

 

public function addEventListeners():void{

      this.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);

      this.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);

      this.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDownHandler);

      this.addEventListener(KeyboardEvent.KEY_UP, myKeyUpHandler);

}

 

/**

* 

 */

private function myKeyDownHandler(event:KeyboardEvent):void {

      trace("myKeyDownHandler(" + event + ")");

      if(event.keyCode == Keyboard.CONTROL){

            this.controlKeyDown = true;

      }

}

 

/**

 * 

 */

private function myKeyUpHandler(event:KeyboardEvent):void{

      trace("myKeyUpHandler(" + event + ")");

      if(event.keyCode == Keyboard.CONTROL){

            this.controlKeyDown = false;

      }

}

Lieven Cardoen
Application developer

indiegroup
interactive digital experience
engelse wandeling 2 k18 
b8500 kortrijk 

 

 

Reply via email to