Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::util::KeyEvent Class Reference

Inheritance diagram for ONE::util::KeyEvent:

Inheritance graph
[legend]
List of all members.

Detailed Description

abstraction for key events

The event layout is similar to the one provided by the SDL. See the SDL documentation for further information on this event. Listeners may choose to consume the event via the KeyEvent::consume() function. Subsequent listeners should check if an incoming event was consumed and should ignore it if it is. However, this behavior is not mandatory and should not be assumed.

Author:
Daniel Seibert


Public Types

enum  Type { KEY_DOWN = SDL_KEYDOWN, KEY_UP = SDL_KEYUP }

Public Member Functions

void consume ()
 marks the event as consumed
 Event (KeyDispatcher *src)
 creates a new event.
const SDL_keysym & getKeysym () const
 accesses the keysym
KeyDispatchergetSource () const
 provides access to the source of the event.
Type getType () const
 accesses the type of the event
bool isConsumed () const
 checks if the event is marked as consumed
 KeyEvent (KeyDispatcher *src, const SDL_keysym &ksym, Type tp)
 KeyEvent (const SDL_KeyboardEvent &e)
 creates a KeyEvent equivalent to the given SDL event


Member Enumeration Documentation

enum ONE::util::KeyEvent::Type
 

Enumerator:
KEY_DOWN 
KEY_UP 


Constructor & Destructor Documentation

ONE::util::KeyEvent::KeyEvent const SDL_KeyboardEvent &  e  ) 
 

creates a KeyEvent equivalent to the given SDL event

Parameters:
e an SDL key event

ONE::util::KeyEvent::KeyEvent KeyDispatcher src,
const SDL_keysym &  ksym,
Type  tp
 


Member Function Documentation

void ONE::util::KeyEvent::consume  )  [inline]
 

marks the event as consumed

In most cases, it is not appropriate to further process consumed events. However, such events are generally still dispatched to the rest of the registered listeners.

ONE::util::Event< KeyDispatcher >::Event KeyDispatcher src  )  [inherited]
 

creates a new event.

Parameters:
src the source of the event

const SDL_keysym & ONE::util::KeyEvent::getKeysym  )  const [inline]
 

accesses the keysym

See the SDL documentation for information on keysyms.

Returns:
the event's keysym

KeyDispatcher * ONE::util::Event< KeyDispatcher >::getSource  )  const [inherited]
 

provides access to the source of the event.

The source of an event is the EventDispatcher that created and dispatched it.

Returns:
this event's source

KeyEvent::Type ONE::util::KeyEvent::getType  )  const [inline]
 

accesses the type of the event

The event represents either a pressed or a released key.

Returns:
KEY_DOWN or KEY_UP

bool ONE::util::KeyEvent::isConsumed  )  const [inline]
 

checks if the event is marked as consumed

See KeyEvent::consume() and the class description for information


Generated on Wed Sep 7 19:03:31 2005 for ONEngine by  doxygen 1.4.3