views:

138

answers:

2

i've drawn an ellipse sprite and added it to the display list of a container, which is added to the display list of the stage. to move the sprites with the keyboard arrows, it appears that my shiftModifier:Number variable is not working when the stage's display state is set to full screen. shiftModifier works as it should when the stage's display state is set to Normal.

stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyboardDown);

function onKeyboardDown(evt:KeyboardEvent):void
    {
    var shiftModifier:int = 1;
    if (evt.shiftKey) {shiftModifier = 10;}

    if (evt.keyCode == Keyboard.UP) {ellipse1.y -= shiftModifier;}
    if (evt.keyCode == Keyboard.DOWN) {ellipse1.y += shiftModifier;}
    if (evt.keyCode == Keyboard.LEFT) {ellipse1.x -= shiftModifier;}
    if (evt.keyCode == Keyboard.RIGHT) {ellipse1.x += shiftModifier;}
    }

fsm.addEventListener(MouseEvent.CLICK, toggleFullScreenMode);
function toggleFullScreenMode(evt:MouseEvent):void
    {
    if (stage.displayState == StageDisplayState.FULL_SCREEN)
        {stage.displayState = StageDisplayState.NORMAL;}
        else
        {stage.displayState = StageDisplayState.FULL_SCREEN;}
    }

full screen is tested in Safari and Firefox.

+1  A: 

Flash Player 9 does not allow keyboard input when displaying content in full-screen mode. Flash Player 10 changes this, allowing for a limited number of keys to be usable in full-screen mode. These include Tab, the Spacebar, and the (up, down, left, right) arrow keys.

From here. Keyboard input is disabled or restricted during fullscreen mode for security reasons (to avoid phishing, as I recall).

fenomas
humm... well, in this case my arrow keys still function as they should while in full screen mode, it's just the shift key modifier doesn't.
TheDarkInI1978
My answer was a touch out of date. Updated.
fenomas
thanks for researching this for me.
TheDarkInI1978
A: 

The shiftKey did work in flash player 10.0 while in full screen, and stopped working when I updated the flash player to 10.1. It's reported as a bug here, please vote to get this fixed.

wessite