Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# EventHandler Class Reference

A class to monitor events from the C++ side of things. More...

Inheritance diagram for EventHandler:

List of all members.

## Public Member Functions
| EventHandler (EventQueue ev_queue)
| dispatchEvent (Event const )
| Calls the hooks assigned to the indicated single event.
| processEvents ()
| The main processing loop of the EventHandler.
| write (ostream out)
## Static Public Member Functions
static TypeHandle | getClassType ()
static EventHandler | getGlobalEventHandler (EventQueue queue)
| Returns a pointer to the one global EventHandler object.
static EventHandler | getGlobalEventHandler ()
| Returns a pointer to the one global EventHandler object.

## Detailed Description

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.

## Constructor & Destructor Documentation

EventHandler | ( | EventQueue | ev_queue | ) |

## Member Function Documentation

dispatchEvent | ( | Event | const | ) |

Calls the hooks assigned to the indicated single event.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from TypedObject.

static EventHandler getGlobalEventHandler | ( |  | ) | `[static]`

Returns a pointer to the one global EventHandler object.

If the global object has not yet been created, this will create it.

static EventHandler getGlobalEventHandler | ( | EventQueue | queue | ) | `[static]`

Returns a pointer to the one global EventHandler object.

If the global object has not yet been created, this will create it.

processEvents | ( |  | ) |

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 | ( | ostream | out | ) |

All Classes Namespaces Functions Variables Enumerations Enumerator Properties