I am struggling with an air flex application. Whenever I click ALT+something, vista makes a sound. I suspect that it is connected with non-existing menu bar.
Any ideas how to disable my app responding to shortcuts where alt is involved?
Here's the code:
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
...
public function onKeyUp(event:KeyboardEvent):void {
trace("inside onKeyUp");
if (event.altKey) {
if (event.keyCode == 69 /* E */) {
detailsBtn.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true));
} else if (event.keyCode == 65 /* A */) {
andmevahetusBtn.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true));
} else if (event.keyCode == 83 /* S */) {
Application.application.close();
} else {
trace("Key pressed. keyCode: " + event.keyCode + ", charCode: " + event.charCode);
}
}
}
I tried everything:
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();
Nothing helped.