Controls

how do I create keyboard controls? I tried using the code provided in the keyboard section of teh manual, but I get an error saying that self is undefined. What do I need to add to define self.

discourse.panda3d.org/viewtopic.php?t=2410