FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::KeyEvent Class Reference

Class for key events. More...

#include <ec_keyevent.h>

+ Inheritance diagram for FIFE::KeyEvent:
+ Collaboration diagram for FIFE::KeyEvent:

Public Types

enum  KeyEventType { UNKNOWN = -1, PRESSED = 0, RELEASED }
 

Public Member Functions

 KeyEvent ()
 Constructor. More...
 
virtual ~KeyEvent ()
 Destructor. More...
 
KeyEventType getType () const
 
void setType (KeyEventType type)
 
bool isNumericPad () const
 
void setNumericPad (bool ispad)
 
const KeygetKey () const
 
void setKey (const Key &key)
 
virtual bool isAltPressed () const
 Checks whether alt is pressed. More...
 
virtual void setAltPressed (bool pressed)
 
virtual bool isControlPressed () const
 Checks whether control is pressed. More...
 
virtual void setControlPressed (bool pressed)
 
virtual bool isMetaPressed () const
 Checks whether meta is pressed. More...
 
virtual void setMetaPressed (bool pressed)
 
virtual bool isShiftPressed () const
 Checks whether shift is pressed. More...
 
virtual void setShiftPressed (bool pressed)
 
virtual void consume ()
 Marks the event as consumed. More...
 
virtual bool isConsumed () const
 Checks if the event is consumed. More...
 
virtual void consumedByWidgets ()
 Marks events as consumed by widget library. More...
 
virtual bool isConsumedByWidgets () const
 
virtual IEventSourcegetSource () const
 Gets the source of the event. More...
 
virtual void setSource (IEventSource *source)
 Sets the source of the event. More...
 
virtual int32_t getTimeStamp () const
 Gets the timestamp of the event. More...
 
virtual void setTimeStamp (int32_t timestamp)
 Sets the timestamp of the event. More...
 
virtual const std::string & getName () const
 Gets the name of the event. More...
 
virtual std::string getDebugString () const
 Gets the debugstring of the event. More...
 
- Public Member Functions inherited from FIFE::InputEvent
 InputEvent ()
 Constructor. More...
 
 ~InputEvent ()
 Destructor. More...
 
virtual std::string getAttrStr () const
 Gets attribute string of the event. More...
 
- Public Member Functions inherited from FIFE::Event
 Event ()
 Constructor. More...
 
virtual ~Event ()
 Destructor. More...
 

Private Attributes

KeyEventType m_eventtype
 
bool m_isnumericpad
 
Key m_key
 

Detailed Description

Class for key events.

Definition at line 45 of file ec_keyevent.h.

Member Enumeration Documentation

Enumerator
UNKNOWN 
PRESSED 
RELEASED 

Definition at line 47 of file ec_keyevent.h.

Constructor & Destructor Documentation

FIFE::KeyEvent::KeyEvent ( )
inline

Constructor.

Definition at line 55 of file ec_keyevent.h.

virtual FIFE::KeyEvent::~KeyEvent ( )
inlinevirtual

Destructor.

Definition at line 63 of file ec_keyevent.h.

Member Function Documentation

virtual void FIFE::KeyEvent::consume ( )
inlinevirtual

Marks the event as consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 83 of file ec_keyevent.h.

References FIFE::InputEvent::consume().

virtual void FIFE::KeyEvent::consumedByWidgets ( )
inlinevirtual

Marks events as consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 85 of file ec_keyevent.h.

References FIFE::InputEvent::consumedByWidgets().

virtual std::string FIFE::KeyEvent::getDebugString ( ) const
inlinevirtual

Gets the debugstring of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 96 of file ec_keyevent.h.

References FIFE::InputEvent::getDebugString().

const Key& FIFE::KeyEvent::getKey ( ) const
inline

Definition at line 71 of file ec_keyevent.h.

References m_key.

Referenced by FIFE::EventManager::processKeyEvent().

+ Here is the caller graph for this function:

virtual const std::string& FIFE::KeyEvent::getName ( ) const
inlinevirtual

Gets the name of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 92 of file ec_keyevent.h.

virtual IEventSource* FIFE::KeyEvent::getSource ( ) const
inlinevirtual

Gets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 87 of file ec_keyevent.h.

References FIFE::InputEvent::getSource().

virtual int32_t FIFE::KeyEvent::getTimeStamp ( ) const
inlinevirtual

Gets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 89 of file ec_keyevent.h.

References FIFE::InputEvent::getTimeStamp().

KeyEventType FIFE::KeyEvent::getType ( ) const
inline

Definition at line 65 of file ec_keyevent.h.

References m_eventtype.

Referenced by FIFE::EventManager::dispatchKeyEvent(), and FIFE::EventManager::processKeyEvent().

+ Here is the caller graph for this function:

virtual bool FIFE::KeyEvent::isAltPressed ( ) const
inlinevirtual

Checks whether alt is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 74 of file ec_keyevent.h.

References FIFE::InputEvent::isAltPressed().

virtual bool FIFE::KeyEvent::isConsumed ( ) const
inlinevirtual

Checks if the event is consumed.

Returns
true if the event is consumed, false otherwise.

Reimplemented from FIFE::InputEvent.

Definition at line 84 of file ec_keyevent.h.

References FIFE::InputEvent::isConsumed().

virtual bool FIFE::KeyEvent::isConsumedByWidgets ( ) const
inlinevirtual

Reimplemented from FIFE::InputEvent.

Definition at line 86 of file ec_keyevent.h.

References FIFE::InputEvent::isConsumedByWidgets().

virtual bool FIFE::KeyEvent::isControlPressed ( ) const
inlinevirtual

Checks whether control is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 76 of file ec_keyevent.h.

References FIFE::InputEvent::isControlPressed().

virtual bool FIFE::KeyEvent::isMetaPressed ( ) const
inlinevirtual

Checks whether meta is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 78 of file ec_keyevent.h.

References FIFE::InputEvent::isMetaPressed().

bool FIFE::KeyEvent::isNumericPad ( ) const
inline

Definition at line 68 of file ec_keyevent.h.

References m_isnumericpad.

virtual bool FIFE::KeyEvent::isShiftPressed ( ) const
inlinevirtual

Checks whether shift is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 80 of file ec_keyevent.h.

References FIFE::InputEvent::isShiftPressed().

virtual void FIFE::KeyEvent::setAltPressed ( bool  pressed)
inlinevirtual

Reimplemented from FIFE::InputEvent.

Definition at line 75 of file ec_keyevent.h.

References FIFE::InputEvent::setAltPressed().

Referenced by FIFE::EventManager::fillKeyEvent(), and FIFE::GUIChanManager::translateKeyEvent().

+ Here is the caller graph for this function:

virtual void FIFE::KeyEvent::setControlPressed ( bool  pressed)
inlinevirtual

Reimplemented from FIFE::InputEvent.

Definition at line 77 of file ec_keyevent.h.

References FIFE::InputEvent::setControlPressed().

Referenced by FIFE::EventManager::fillKeyEvent(), and FIFE::GUIChanManager::translateKeyEvent().

+ Here is the caller graph for this function:

void FIFE::KeyEvent::setKey ( const Key key)
inline

Definition at line 72 of file ec_keyevent.h.

References m_key.

Referenced by FIFE::EventManager::fillKeyEvent(), and FIFE::GUIChanManager::translateKeyEvent().

+ Here is the caller graph for this function:

virtual void FIFE::KeyEvent::setMetaPressed ( bool  pressed)
inlinevirtual

Reimplemented from FIFE::InputEvent.

Definition at line 79 of file ec_keyevent.h.

References FIFE::InputEvent::setMetaPressed().

Referenced by FIFE::EventManager::fillKeyEvent(), and FIFE::GUIChanManager::translateKeyEvent().

+ Here is the caller graph for this function:

void FIFE::KeyEvent::setNumericPad ( bool  ispad)
inline

Definition at line 69 of file ec_keyevent.h.

References m_isnumericpad.

Referenced by FIFE::EventManager::fillKeyEvent(), and FIFE::GUIChanManager::translateKeyEvent().

+ Here is the caller graph for this function:

virtual void FIFE::KeyEvent::setShiftPressed ( bool  pressed)
inlinevirtual

Reimplemented from FIFE::InputEvent.

Definition at line 81 of file ec_keyevent.h.

References FIFE::InputEvent::setShiftPressed().

Referenced by FIFE::EventManager::fillKeyEvent(), and FIFE::GUIChanManager::translateKeyEvent().

+ Here is the caller graph for this function:

virtual void FIFE::KeyEvent::setSource ( IEventSource source)
inlinevirtual

Sets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 88 of file ec_keyevent.h.

References FIFE::InputEvent::setSource().

Referenced by FIFE::EventManager::processKeyEvent().

+ Here is the caller graph for this function:

virtual void FIFE::KeyEvent::setTimeStamp ( int32_t  timestamp)
inlinevirtual

Sets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 90 of file ec_keyevent.h.

References FIFE::InputEvent::setTimeStamp().

void FIFE::KeyEvent::setType ( KeyEventType  type)
inline

Definition at line 66 of file ec_keyevent.h.

References m_eventtype.

Referenced by FIFE::EventManager::fillKeyEvent(), and FIFE::GUIChanManager::translateKeyEvent().

+ Here is the caller graph for this function:

Member Data Documentation

KeyEventType FIFE::KeyEvent::m_eventtype
private

Definition at line 99 of file ec_keyevent.h.

Referenced by getType(), and setType().

bool FIFE::KeyEvent::m_isnumericpad
private

Definition at line 100 of file ec_keyevent.h.

Referenced by isNumericPad(), and setNumericPad().

Key FIFE::KeyEvent::m_key
private

Definition at line 101 of file ec_keyevent.h.

Referenced by getKey(), and setKey().


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