Capture CTRL+N / CMD+N in Flex/Air/AS3
by Nicolas Noben
When you program features for (web) application, it’s often useful & good practice to allow users shortcuts for common actions.
This easy snippets shows how to capture ‘new’ or Control+N or Command+N on the Mac.
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
private function keyDown(e:KeyboardEvent) :void
{
if(e.commandKey || e.ctrlKey)
{
switch(e.keyCode)
{
case Keyboard.N:
// do stuff
break;
}
}
}
Related Posts
- Easy Form Validation and Submit Button enable-disable in Flex 3
- Database of snippets of code for AS3
- Pianographique
- Bubbl.us makes brainstorming easy
- Automatically resize Text/TextArea based on content (autoSize) in Flex

Stay focussed. Save to
Del.icio.us |
Reddit |
Stumble it |
Digg it

