r206 Browser Focus v Keyboard Key-Is-Down

0 favourites
  • 3 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Problem Description

    If your browser window loses focus (by clicking on another tab / open program) whilst you have a key pressed then, on becoming focused again, the engine registers that the key is still pressed even if it is not. The problem becomes rectified after you press then release the same key again.

    Attach a Capx


    Description of Capx

    The capx contains an object that can be moved left and right by holding down the arrow keys, using events.

    Steps to Reproduce Bug

    • Hold down Right arrow key and, with the key still pressed, change desktop focus - then release the arrow key
    • Return to the browser window and observe the object is still moving right
    • Try pressing Left arrow key and then release (+ observe object stops moving) then press the Right arrow key again - and observe that, when you release the key, the keydowns are subsequently correctly sensed

    Observed Result

    As per above.

    Expected Result

    When the layout's browser is in focus, all key-is-downs should be correctly sensed irrespective of their condition when the browser lost focus.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    W8.1 x64

    Construct 2 Version ID

    r206 64 bit

  • There's nothing we can do about this: for security reasons the browser does not send any keyboard events to the page when the window is not focused (obviously - otherwise every web page could be a keylogger). However since the page never gets a key up event it thinks the key is still down. I don't believe there is anything that can be done about this, so closing as won't fix.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • !

    I guess a browser back in focus check will be required to negate this....

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)