Search Issue Tracker

Fixed in 5.5.0

Votes

0

Found in

5.3.4p2

Issue ID

797338

Regression

No

[WebGL] Input.GetKey gets stuck when changing focus

WebGL

-

Steps to reproduce:
1. Download and open attached project "GetKeyBug.zip"
2. Build for WebGL including "Scene" scene
3. In browser, open up console
4. Press and hold left shift, while doing so, switch focus to other window
5. Go back to the browser window with built project

Actual result: Console keeps logging that the left shift is still being pressed
Expected result: Key does not stay pressed if focus is lost

Tested and reproduced on:
Windows 10
Unity 5.2.4p1, 5.3.5p1, 5.4.0b18

Browsers tested:
Google Chrome 50.0.2661.102 (Official Build) m (32-bit)
Google Chrome 52.0.2738.0 (Official Build) canary (64-bit)
Firefox 43.0.4

Comments (3)

  1. 71427cdf707931b1f90c4eaf26bf9a45?d=mm

    DakataDev

    Apr 03, 2018 14:17

    HI Team,

    I can still reproduce the issue.
    Steps
    1. Press and hold key (monitor the input using Input.GetKey())
    2. While pressing and holding right click outside of the Unity Canvas
    3. Unity still receives Input.GetKey() as true even if no key is actually pressed

    Unity 3D used : 2017.2.1p2
    Browser : Chrome, Firefox

  2. C2a27df4a6e6a14f4e7b1f750af27fda?d=mm

    Ewanuk

    Nov 24, 2017 14:47

    This issue isn't fixed. Still present in 5.5.1f1

    1) Hold CTRL
    2) Click outside webGL canvas
    3) Release Control
    4) Return mouse cursor over canvas
    5) Even clicking back into the webGL canvas doesn't fix it, you have to press+release the key

  3. 3d0c5c45f3dcb91a0b809b220d39797b?d=mm

    BMacZero

    Sep 23, 2017 17:32

    I can still reproduce a similar issue on 5.6.2f1 with these adjusted steps:
    3. In the WebGL build, hold down a key (in this example, Left Shift)
    4. Right-Click outside of the game view to bring up a context menu
    5. Release Left Shift
    6. Click on the game view

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.