mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
getGlobalEventHandler()
This commit is contained in:
parent
dcc8d1d552
commit
1790459221
@ -20,7 +20,11 @@ class EventManager:
|
|||||||
self.eventQueue = eventQueue
|
self.eventQueue = eventQueue
|
||||||
else:
|
else:
|
||||||
self.eventQueue = EventQueue.getGlobalEventQueue()
|
self.eventQueue = EventQueue.getGlobalEventQueue()
|
||||||
self.eventHandler = EventHandler(self.eventQueue)
|
|
||||||
|
try:
|
||||||
|
self.eventHandler = EventHandler.getGlobalEventHandler(self.eventQueue)
|
||||||
|
except:
|
||||||
|
self.eventHandler = EventHandler(self.eventQueue)
|
||||||
|
|
||||||
def doEvents(self):
|
def doEvents(self):
|
||||||
"""
|
"""
|
||||||
@ -46,9 +50,9 @@ class EventManager:
|
|||||||
return eventParameter.getDoubleValue()
|
return eventParameter.getDoubleValue()
|
||||||
elif (eventParameter.isString()):
|
elif (eventParameter.isString()):
|
||||||
return eventParameter.getStringValue()
|
return eventParameter.getStringValue()
|
||||||
# Must be some user defined type, return the ptr
|
|
||||||
# which will be downcast to that type
|
|
||||||
else:
|
else:
|
||||||
|
# Must be some user defined type, return the ptr
|
||||||
|
# which will be downcast to that type
|
||||||
return eventParameter.getPtr()
|
return eventParameter.getPtr()
|
||||||
|
|
||||||
def processEvent(self, event):
|
def processEvent(self, event):
|
||||||
@ -75,9 +79,8 @@ class EventManager:
|
|||||||
messenger.send(eventName)
|
messenger.send(eventName)
|
||||||
# Also send the event down into C++ land
|
# Also send the event down into C++ land
|
||||||
self.eventHandler.dispatchEvent(event)
|
self.eventHandler.dispatchEvent(event)
|
||||||
|
|
||||||
# An unnamed event from C++ is probably a bad thing
|
|
||||||
else:
|
else:
|
||||||
|
# An unnamed event from C++ is probably a bad thing
|
||||||
EventManager.notify.warning('unnamed event in processEvent')
|
EventManager.notify.warning('unnamed event in processEvent')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user