Search code examples
flashactionscript-3google-chromehaxe

Troubles with keyboardEvent.shiftKey in Chrome


I'd met a very strange problem. Take a look at the following code:

Lib.current.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
...
private static function onKeyPressed(e: KeyboardEvent) {
    trace(e.shiftKey);
}

if you press any key (except SHIFT) false is outputed. Press SHIFT+ALT (first press SHIFT and then ALT). Then after pressing of any key true is outputed. Note that if I press SHIFT, press of any key will output false again.

you may download swf containing code listed above from here.

IMPORTANT: I have this issue only on Chrome, e.g. on Firefox everything is ok.

Note: If that's important, I'm working with Haxe languge, not with AS3.

Any thoughts will be appreciated. Thank you in advance!!


Solution

  • Go into chrome://plugins/ in a new tab. Check and see if under the flash section you have more than 1 flash plugins installed for Chrome. If so, disable the older version(s) and then try your test again.