Search Unity

Browser input working together with WebGL

Discussion in 'Web' started by Simon_says, Oct 24, 2015.

  1. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    When I'm using arrows in my game, the whole website is moving(e.g. when tapping up and down arrow, it works like scroll). Is that intended behavior or just default? Is there a way to fix this?

    It happens on Chrome, not on Firefox.
     
    Last edited: Oct 27, 2015
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Do you get the same behavior in full-screen mode ?
     
  3. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    I believe no. How can I even see the website moving if the game is full screen?) I actually remove the full screen button because my games are made to fit my website, and are meant to be played in that size.
     
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    True. I meant to ask if the up/down arrow buttons work in fullscreen mode.

    Does your webgl canvas have focus when pressing up/down arrows ?

    Anyway, I think we let the browser handle those key presses after we process them. Let me check...
     
    Last edited: Oct 27, 2015
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    In Unity 5.2.2 I am not seeing the behavior you described. Which Unity version are you using ?
     
  6. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    5.2.2f1, it happens only in chrome. I will send you the game link in pm.
     
  7. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    I am able to repro the same problem in Chrome (Firefox works fine). I'll create a bug report and investigate the issue.
     
    Simon_says likes this.
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
  9. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Still happens in 5.3.1. Any prediction of when it'll be fixed? Really annoying.
     
  10. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    should be fixed in 5.3.1p4 or newer.
     
  11. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    I am trying to build webgl with unity 5.4, but arrows and WASD input don't work in the web page (both firefox and chrome). I tried modifying the page code as suggested in another post, but it was not possible to fix it. Do you have any suggestions? Thanks