EventHandler

from panda3d.core import EventHandler
class EventHandler

Bases: TypedObject

A class to monitor events from the C++ side of things. It maintains a set of “hooks”, function pointers assigned to event names, and calls the appropriate hooks when the matching event is detected.

This class is not necessary when the hooks are detected and processed entirely by the scripting language, e.g. via Scheme hooks or the messenger in Python.

Inheritance diagram

Inheritance diagram of EventHandler

__init__(*args, **kwargs)
dispatchEvent()

C++ Interface: dispatch_event(const EventHandler self, const Event event)

/**
  • Calls the hooks assigned to the indicated single event.

*/

dispatch_event()

C++ Interface: dispatch_event(const EventHandler self, const Event event)

/**
  • Calls the hooks assigned to the indicated single event.

*/

getClassType()

C++ Interface: get_class_type()

getFuture()

C++ Interface: get_future(const EventHandler self, str event_name)

/**
  • Returns a pending future that will be marked as done when the event is next

  • fired.

*/

getGlobalEventHandler()

C++ Interface: get_global_event_handler(EventQueue queue)

/**
  • Returns a pointer to the one global EventHandler object. If the global

  • object has not yet been created, this will create it.

*/

get_class_type()

C++ Interface: get_class_type()

get_future()

C++ Interface: get_future(const EventHandler self, str event_name)

/**
  • Returns a pending future that will be marked as done when the event is next

  • fired.

*/

get_global_event_handler()

C++ Interface: get_global_event_handler(EventQueue queue)

/**
  • Returns a pointer to the one global EventHandler object. If the global

  • object has not yet been created, this will create it.

*/

processEvents()

C++ Interface: process_events(const EventHandler self)

/**
  • The main processing loop of the EventHandler. This function must be called

  • periodically to service events. Walks through each pending event and calls

  • its assigned hooks.

*/

process_events()

C++ Interface: process_events(const EventHandler self)

/**
  • The main processing loop of the EventHandler. This function must be called

  • periodically to service events. Walks through each pending event and calls

  • its assigned hooks.

*/

write()

C++ Interface: write(EventHandler self, ostream out)

/**

*/