Listen for the combination of the Shift key and key code 80
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="initApp()">
<mx:Script>
private function initApp():void {
application.addEventListener(KeyboardEvent.KEY_UP,keyHandler);
myCanvas.setFocus();
}
private function keyHandler(event:KeyboardEvent):void {
var bShiftPressed:Boolean = event.shiftKey;
if (bShiftPressed) {
var curKeyCode:int = event.keyCode;
if (curKeyCode == 80) {
trace("hi");
}
}
}
</mx:Script>
<mx:Canvas id="myCanvas" />
</mx:Application>
Related examples in the same category