Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

doNotCaptureKeyboard: true does not work in Unity 5.1

Discussion in 'WebGL' started by Jungnissen, Jun 9, 2015.

  1. Jungnissen

    Jungnissen

    Joined:
    Sep 4, 2014
    Posts:
    5
    Hi,

    As the the topic states, the doNotCaptureKeyboard option for Modul in the generated html file:

    Code (JavaScript):
    1. var Module = {
    2.         doNotCaptureKeyboard: true,
    Has no effect in Unity 5.1, but did in Unity 5.0.

    Any idea for a solution for instead of doNotCaptureKeyboard?

    Thx
     
    Last edited: Jun 10, 2015
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    We rewrote the input handling in Unity 5.1 to use a more low level implementation to fix several bugs in emscripten's SDL wrapper. Unfortunately, that means that doNotCaptureKeyboard will no longer work, as that is handled by emscripten's SDL wrapper. Instead, we are adding a new API which allows you to turn on and off keyboard capturing at runtime from your game code. This will be in 5.2, and possibly also in a 5.1.x patch release.
     
    romaing and baillyje like this.
  3. Jungnissen

    Jungnissen

    Joined:
    Sep 4, 2014
    Posts:
    5
    Hi Jonas

    Thank you for replying on this topic, and thx for the heads up.

    I will wait with the upgrade, until this feature is ready.
     
  4. romaing

    romaing

    Joined:
    Feb 11, 2010
    Posts:
    24
    Any news about this issue? or workaround?
     
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    We are planning to include the solution to this problem in a future patch, probably next week.
     
  6. abryden

    abryden

    Joined:
    Sep 29, 2014
    Posts:
    24
    Was this fixed in 5.1.1p4?

    Thanks!
     
  7. cchacon

    cchacon

    Joined:
    Sep 20, 2015
    Posts:
    18
    We are Jan 2016, is this fixed ?
     
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    fortunefaded2201 likes this.
  9. lloydsummers

    lloydsummers

    Joined:
    May 17, 2013
    Posts:
    344
    Also don't forget if you don't capture all input, you need to add something to your index page to push keyboard events to it when it is selected. Otherwise it will ignore keyboard commands always
     
  10. cchacon

    cchacon

    Joined:
    Sep 20, 2015
    Posts:
    18
    thanks guys!