r206 Browser Focus v Keyboard Key-Is-Down

Bugs will be moved here once resolved.

Post » Tue Jun 16, 2015 7:45 pm

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
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
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Thu Jun 18, 2015 4:13 pm

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.
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,746

Post » Thu Jun 18, 2015 4:41 pm

!

I guess a browser back in focus check will be required to negate this....
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832


Return to Closed bugs

Who is online

Users browsing this forum: kingpirux and 0 guests