Jump to content

keypress on canvas not working


masterdon
 Share

Recommended Posts

Hi Team,

I am having a PG here http://www.babylonjs-playground.com/#SUXKHY#43 .

FYI, as per requirement, with the help of legendary @Wingnut, camera rotation has been disabled here.  by limiting arcCam alpha and beta.

Now i am trying to assign key events on canvas for mesh movements. keydown and keyup are working fine. however, keypress is failing. code is at line number 149.

what could be the reason?

 

 

Link to comment
Share on other sites

KeyPress works because it logs, but with no effect in the scene when exchanging keypress and keydown events.

In my browser, "keypress" has a different event object than "keyup" and "keydown" (keyCode is missing). KeyCode being deprecated (https://developer.mozilla.org/fr/docs/Web/Events/keydown), you might want to use a more reliable event property.

Fixed here : http://www.babylonjs-playground.com/#SUXKHY#44 , if that's what your issue is.

Best regards,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...