My game involves input from a keyboard using WASD. When W and D are pressed, the camera should move up and to the right. When I hold both buttons down and release them at the same time, the camera continues to move in one of the directions pressed.
It seems that rather than triggering both events for the W key being released and the D key being released, only one event is triggered since they both happen at practically the same time.
Is there a way in panda3d to handle keyboard input in a non event driven way? For example, can I just check if a certain key on the keyboard is pressed? If not, do you have any other suggestions as to how I should handle this problem?
I myself prefer not to do it the Roaming Ralph way (store the keymap in a dict) but do it the ButtonHandle way, since it eliminates the alt+tab issue, and for other reasons. It’s just easier and requires less code.
I have tried doing my keyboard input using base.mouseWatcherNode and I still run into the same problem. If I release two buttons at pretty much the same time, one of the keys is always recognized as being pressed until I press the button again and release it.
In that thread below the main snippet from mindstormss there is another one from ynjh_jo, that does polling in the way you describe. With little error though (probably, because of some recent change in Panda code): delete key is now simply “delete”.