Hi everyone,
During testing I noticed some of the testers would accidentally hit the Windows key, and be torn from the game back to the Start Menu in Windows. It’s a HaxeFlixel-based game, but I’m pretty sure there’s no flixelish way to swallow the keypress, so what I was trying to do was simply this. In Main.new():
Lib.current.stage.addEventListener(KeyboardEvent.KEY_DOWN, stopEvent);
Lib.current.stage.addEventListener(KeyboardEvent.KEY_UP, stopEvent);
And in Main:
function stopEvent(e:Dynamic)
{
if (e.keyCode == 15) {
e.stopPropagation();
e.stopImmediatePropagation();
}
}
But it doesn’t prevent anything, unfortunately. With a trace statement in stopEvent() I can verify that it is in fact being called on down/up with code 15, but the two stop*() calls don’t seem to do what I would like them to.
Any advice?
Thanks,
Gimmicky