evanxg Posted May 4, 2014 Share Posted May 4, 2014 Helo guys,I started writing a spaceship game with pandaJs.But I am not getting the right behavior for the keyboard keydown event.What I am expecting is the keydown callback to be called multiple times as long as the any key is down but it only fires once. I want my ship to keep moving left when KEY_LEFT is held downOr to keep firing when KEY_SPACE is down I looked into the source code of panda Js and modified the line 210 file: https://github.com/ekelokorpi/panda.js/blob/master/src/engine/keyboard.jsI commented the line 210 so it keep calling back however the there is a delay between the first call and the subsequent call of the keydown callback:for instance holding the LEFT_KEY makes the ship moves one step to the left (one step is 6px) and then wait some milliseconds before starting a continues move to the left. I am not able to fix that. Please help. I think there should be a configuration member to the keyboard module so that I can enable continuous firing of the keydown or at least this should be the default behaviour as in most cases. thanks in advance Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.