Posted By

keyle on 11/23/08


Tagged

new capture keyboard eventlistener keyboardevent


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

THEPWN3R
Pingpongbal
TrentSkunk


Capture CTRL+N or CMD+N


 / Published in: ActionScript 3
 

  1. stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
  2.  
  3. private function keyDown(e:KeyboardEvent) :void
  4. {
  5. if(e.commandKey || e.ctrlKey)
  6. {
  7. switch(e.keyCode)
  8. {
  9. case Keyboard.N:
  10. // do stuff
  11. break;
  12. }
  13. }
  14.  
  15. }

Report this snippet  

You need to login to post a comment.