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 (5)

  1. axrossroad

    Dec 20, 2021 08:54

    Not fixed in 2021.2.7f1.
    Not fixed in 2020.3.25f1.
    Not fixed in 2019.4.13
    Not fixed in legacy input system.
    Not fixed in new input system

  2. slidecrew

    Oct 20, 2020 16:53

    This is still not fixed in Unity 2020.1.9f1

  3. 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

  4. 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

  5. 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.