In Actionscript, you can detect Alt/Control/■■■■ + Whatever other key you press like this:
AS3:
stage.addEventListener(KeyboardEvent.KEY_DOWN, displayKey);
function displayKey(keyEvent:KeyboardEvent)
{
var modifier:String = "";
if (keyEvent.ctrlKey)
{
modifier = "Ctrl + ";
}
else if (keyEvent.altKey)
{
modifier = "Alt + ";
}
else if (keyEvent.shiftKey)
{
modifier = "Shift + ";
}
yText.text = modifier + keyEvent.keyCode;
}
In AS2 you can do this:
var keyListener:Object = new Object();
keyListener.onKeyDown = function()
{
yText.text = Key.getCode();
}
Key.addListener(keyListener);
But this AS2 code only allow single detection of keys, does AS2 support detecting of control/Alt/Shift + other keys like AS3 ?