keypanda3d

panda3d - key.accept does funny things


I am using panda3d for a game, however, I am having some difficulties with accept:

 def acceptKeys(self):



    base.accept("arrowLeft", self.setKeys, ["arrowLeft",1])
    base.accept("arrowRight", self.setKeys, ["arrowRight",1])
    base.accept("arrowUp", self.setKeys, ["arrowUp",1])
    base.accept("arrowDown", self.setKeys, ["arrowDown",1])
    base.accept("space", self.setKeys, ["space",1])

The thing is, it works absolutely fine for space. It does NOT work for any of the othe keys, and I have tried it with charakter keys (such as w a s d), too!

Just nothing seems to happen when a key is pressed.

I did use the keynames that are given in the manual for panda3d. Any ideas?


Solution

  • The manual states that you should use:

       arrow_left
       arrow_right
       arrow_up
       arrow_down
    

    Maybe it's that simple?