Public Member Functions

wit::EventHandler Class Reference

#include <wit/eventhandler.h>

List of all members.

Public Member Functions

virtual ~EventHandler ()
virtual bool event (Event *event)
virtual bool joystickEvent (JoystickEvent *event)
virtual bool analogEvent (AnalogEvent *event)
virtual bool motionEvent (MotionEvent *event)
virtual bool pointerEvent (PointerEvent *event)
virtual bool pointerLeaveEvent (PointerLeaveEvent *event)
virtual bool buttonPressEvent (ButtonEvent *event)
virtual bool buttonReleaseEvent (ButtonEvent *event)
virtual void timerTriggered (void *data)

Detailed Description

The EventHandler class is the base class for all objects that wish to process events.

On its own, EventHandler does very little. An EventHandler object must be installed as an event filter (see Application::installEventFilter()), pushed on a focus stack (see Application::pushFocus()), or assigned to a region of the screen (see Hotspot) in order to receive events. When installed as an event filter, the object will receive every event processed by WIT. When pushed onto a focus stack, the object will receive non-pointer events from the associated controller. When assigned to a region of the screen, the object will receive pointer events when the Wii Remote is pointing at the region.

By default, none of EventHandler's functions do anything. You must subclass EventHandler to implement behavior.

Definition at line 14 of file eventhandler.h.


Constructor & Destructor Documentation

wit::EventHandler::~EventHandler (  ) [virtual]

Destroys the EventHandler object.

If the object was installed as an event filter or present on any focus stack, it is removed.

Definition at line 30 of file eventhandler.cpp.


Member Function Documentation

bool wit::EventHandler::analogEvent ( AnalogEvent event ) [virtual]

Processes an analog button event.

The default behavior returns false.

See also:
event()

Definition at line 90 of file eventhandler.cpp.

bool wit::EventHandler::buttonPressEvent ( ButtonEvent event ) [virtual]

Processes a non-analog button press event.

The default behavior returns false.

See also:
event()

Definition at line 142 of file eventhandler.cpp.

bool wit::EventHandler::buttonReleaseEvent ( ButtonEvent event ) [virtual]

Processes a non-analog button release event.

The default behavior returns false.

See also:
event()

Definition at line 155 of file eventhandler.cpp.

bool wit::EventHandler::event ( Event event ) [virtual]

Processes an event.

Return true from event() or one of the other event-handling functions to consume the event, that is, to prevent the event from propagating to the next object in the event chain or focus stack.

For non-user event types, the default behavior invokes the appropriate specialized event-handling function (which themselves by default do nothing but return false); for user event types, the default behavior returns false.

Definition at line 47 of file eventhandler.cpp.

bool wit::EventHandler::joystickEvent ( JoystickEvent event ) [virtual]

Processes a joystick event.

The default behavior returns false.

See also:
event()

Definition at line 77 of file eventhandler.cpp.

bool wit::EventHandler::motionEvent ( MotionEvent event ) [virtual]

Processes a motion sensor event.

The default behavior returns false.

See also:
event()

Definition at line 103 of file eventhandler.cpp.

bool wit::EventHandler::pointerEvent ( PointerEvent event ) [virtual]

Processes a pointer event.

The default behavior returns false.

See also:
event()

Reimplemented in wit::Widget.

Definition at line 116 of file eventhandler.cpp.

bool wit::EventHandler::pointerLeaveEvent ( PointerLeaveEvent event ) [virtual]

Processes a pointer leave event.

The default behavior returns false.

See also:
event()

Reimplemented in wit::Widget.

Definition at line 129 of file eventhandler.cpp.

void wit::EventHandler::timerTriggered ( void *  data ) [virtual]

Invoked when a timer requested using Application::scheduleTimer() expires. data is the user data pointer passed to scheduleTimer().

The default behavior does nothing.

See also:
Application::scheduleTimer()

Definition at line 169 of file eventhandler.cpp.


The documentation for this class was generated from the following files: