mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
added getEventName
This commit is contained in:
parent
14b7dd6d25
commit
41d610f87d
@ -99,6 +99,9 @@ class InputState(DirectObject.DirectObject):
|
|||||||
else:
|
else:
|
||||||
return name in self._state
|
return name in self._state
|
||||||
|
|
||||||
|
def getEventName(self, name):
|
||||||
|
return "InputState-%s" % (name,)
|
||||||
|
|
||||||
def set(self, name, isActive, inputSource=None):
|
def set(self, name, isActive, inputSource=None):
|
||||||
assert self.debugPrint("set(name=%s, isActive=%s, inputSource=%s)"%(name, isActive, inputSource))
|
assert self.debugPrint("set(name=%s, isActive=%s, inputSource=%s)"%(name, isActive, inputSource))
|
||||||
# inputSource is a string that identifies where this input change
|
# inputSource is a string that identifies where this input change
|
||||||
@ -119,7 +122,7 @@ class InputState(DirectObject.DirectObject):
|
|||||||
# We change the name before sending it because this may
|
# We change the name before sending it because this may
|
||||||
# be the same name that messenger used to call InputState.set()
|
# be the same name that messenger used to call InputState.set()
|
||||||
# this avoids running in circles:
|
# this avoids running in circles:
|
||||||
messenger.send("InputState-%s"%(name,), [self.isSet(name)])
|
messenger.send(self.getEventName(name), [self.isSet(name)])
|
||||||
|
|
||||||
def releaseInputs(self, name):
|
def releaseInputs(self, name):
|
||||||
# call this to act as if all inputs affecting this state have been released
|
# call this to act as if all inputs affecting this state have been released
|
||||||
|
Loading…
x
Reference in New Issue
Block a user