i found this piece of code in the manual and i have a few questions about it:
class ReadKeys(DirectObject.DirectObject):
def __init__(self):
self.accept('time-a-repeat', self.printRepeat)
def printRepeat(self,a):
print "repeat a",a
i tried it and am i correct that it gives the global time it was pressed?
and i see that the function needs the “self” argument and the “a” argument.
am i correct in assuming that a holds the time?
and what if i have a system like this:
def turn(self, buttons):
if buttons == "a":
turn left
elif buttos == "d"
turn right
would i need to have both keys as arguments?
def turn(self,a,d):
or is there another way?
thanks in advance,
assainator