When player is holding down a key on the keyboard and something takes the focus away from the game. Either an errant click outside of the game window, a right click outside of the game window, a steam alert popping up over the game, etc the game 'remembers' the key that was down and persists with pushing it even though window is not in focus. when returning to the game window, the key will continue to be pushed, even if it's not actually being pushed... the only way to 'fix' the issue is to hit that key again, causing it's state to reset.
Attach a Capx
Description of Capx
Simple 8 direction movement via arrow keys...
Steps to Reproduce Bug
Lose focus to game = key pressed / touch states are forced to 'let go'.
Operating System and Service Pack
Construct 2 Version ID
i thought perhaps if there was even a 'release all keys' option in the keyboard object i could simply do it via an action like "On Suspend: Release Keys" or something but "On Suspend" doesnt seem to apply to something like a 'right click', so I dont know if this is fixable...
I believe this happens to all keyboard input when it comes to loosing focus. In my case, any event that uses [When Key is down] will cause the key to constantly hold when looses focus even when the key isn't physically held down any more.
EDIT* It may happen to consoles too
Develop games in your browser. Powerful, performant & highly capable.
Is there some workaround for this, you think? other than checking every tick for all keys and releasing if theyre not actually down?! (Isnt it already doing that?)
I don't think this is a C2 issue.
Well I appreciate that, and Im certainly not trying to argue or be offensive, but it's an issue in that games created with C2 have this problem, even when built as standalone executables. Other commercial games and applications do not have this issue.
If i had the capabilities to code my game from scratch, this is something I would try to resolve. Because I'm relying on C2 and have no way to resolve (to my knowledge) using the tools within C2, i'm reporting it as a bug.
Sorry, I don't think there is anything we can do about this. If the browser loses focus then the browser does not fire the key up event. I think some native apps are affected by this too, as well as any other engine/framework running in a browser. It's more to do with how the OS deals out events to different apps.
dang, thats a bummer.. A couple testers have said it can be annoying and i haven't even done the full release / passed keys to all kickstarter backers yet. (small sample size)