Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Events KeyDown and KeyUp does not work in HTML5? — Gideros Forum

Events KeyDown and KeyUp does not work in HTML5?

kinrpgkinrpg Member
edited August 2016 in General questions
Greetings,
I made an app that uses the KEY_DOWN and KEY_UP events and functioned normally in the player and windows. However if I export to html5 the event does not work. keyboard events does not really work in html5 or I have to activate a feature?
I read the documentation and found nothing about.
Thank you.

Comments

  • hgy29hgy29 Maintainer
    They ought to work, if not then there is a bug :( I'll have a look!
    On which browser did you test ?

    Likes: kinrpg

    +1 -1 (+1 / -0 )Share on Facebook
  • kinrpgkinrpg Member
    edited August 2016
    Chrome and firefox. Touch and click is working.
  • @kinrpg Do the up/dn keys work in this for you?

    http://www.sinistersoft.com/bacteria/gideros.html

    if so then it must be your code somehow?

    Likes: kinrpg

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • talistalis Guru
    edited August 2016 Accepted Answer
    @SinisterSoft in the menu arrow and space keys are working but inside game nothing working. Firefox latest version.
    Should be like this?

    Likes: kinrpg

    +1 -1 (+1 / -0 )Share on Facebook
  • @kinrpg Do the up/dn keys work in this for you?

    http://www.sinistersoft.com/bacteria/gideros.html

    if so then it must be your code somehow?
    Hi, I press the up and down and nothing happens. Click, mucisas animations and function normally.
    I used google chrome.
  • Well, it looks like I found the problem. On several occasions when loading gideros.html file is necessary for the browser to a focus on the html of the body. I realized that if I keep clicking on the logo Gideros loading, then the keyboard works normally. However even if I click on top of the game after loading it happens then the keyboard does not work.
    The solution was to create a index.html with a hyperlink that calls the gideros.html when clicked.

    Test for windows and html5
    http://gamejolt.com/games/a-ultima-cerveja/181546

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • I only have to click on the webpage once and it works for me? In the bacteria demo, where did you click for the keyboard not to work (a screenshot would be best) - I'll see if it also happens for me here. :)

    Likes: kinrpg

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    There is at least one other good reason to have the user click on the app: on most browsers, sounds are not allowed to play until the user click at least once.

    Likes: kinrpg

    +1 -1 (+1 / -0 )Share on Facebook
  • I think what happens is that in some servers that you upload the html5 they display the gideros.html within a or through an include ... I think that causes a browser loss of focus and he does not know where you run the keyboard.
  • There is at least one other good reason to have the user click on the app: on most browsers, sounds are not allowed to play until the user click at least once.
    Yes, so it's interesting for the game in html5 attract the click of the player, either through a play button or menu option, customizing the mouse cursor etc ... Well, but the good news is that it is not a Gideros bug but a feature of how the web platform.
Sign In or Register to comment.