FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::KeyEvent Class Reference

Class for key events. More...

#include <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)
 Sets alt to pressed. More...
 
virtual bool isControlPressed () const
 Checks whether control is pressed. More...
 
virtual void setControlPressed (bool pressed)
 Sets control to pressed. More...
 
virtual bool isMetaPressed () const
 Checks whether meta is pressed. More...
 
virtual void setMetaPressed (bool pressed)
 Sets meta to pressed. More...
 
virtual bool isShiftPressed () const
 Checks whether shift is pressed. More...
 
virtual void setShiftPressed (bool pressed)
 Sets shift to pressed. More...
 
virtual void consume ()
 Marks events as consumed. More...
 
virtual bool isConsumed () const
 Checks whether event is consumed. More...
 
virtual void consumedByWidgets ()
 Marks events as consumed by widget library. More...
 
virtual bool isConsumedByWidgets () const
 Checks whether event is consumed by widget library. More...
 
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 keyevent.h.

Member Enumeration Documentation

◆ KeyEventType

Enumerator
UNKNOWN 
PRESSED 
RELEASED 

Definition at line 47 of file keyevent.h.

Constructor & Destructor Documentation

◆ KeyEvent()

FIFE::KeyEvent::KeyEvent ( )
inline

Constructor.

Definition at line 55 of file keyevent.h.

◆ ~KeyEvent()

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

Destructor.

Definition at line 63 of file keyevent.h.

Member Function Documentation

◆ consume()

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

Marks events as consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 83 of file keyevent.h.

References FIFE::InputEvent::consume().

◆ consumedByWidgets()

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

Marks events as consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 85 of file keyevent.h.

References FIFE::InputEvent::consumedByWidgets().

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

+ Here is the caller graph for this function:

◆ getDebugString()

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

Gets the debugstring of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 96 of file keyevent.h.

References FIFE::InputEvent::getDebugString().

◆ getKey()

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

Definition at line 71 of file keyevent.h.

References m_key.

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

+ Here is the caller graph for this function:

◆ getName()

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 keyevent.h.

◆ getSource()

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

Gets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 87 of file keyevent.h.

References FIFE::InputEvent::getSource().

◆ getTimeStamp()

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

Gets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 89 of file keyevent.h.

References FIFE::InputEvent::getTimeStamp().

◆ getType()

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

Definition at line 65 of file keyevent.h.

References m_eventType.

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

+ Here is the caller graph for this function:

◆ isAltPressed()

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

Checks whether alt is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 74 of file keyevent.h.

References FIFE::InputEvent::isAltPressed().

◆ isConsumed()

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

Checks whether event is consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 84 of file keyevent.h.

References FIFE::InputEvent::isConsumed().

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

+ Here is the caller graph for this function:

◆ isConsumedByWidgets()

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

Checks whether event is consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 86 of file keyevent.h.

References FIFE::InputEvent::isConsumedByWidgets().

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

+ Here is the caller graph for this function:

◆ isControlPressed()

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

Checks whether control is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 76 of file keyevent.h.

References FIFE::InputEvent::isControlPressed().

◆ isMetaPressed()

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

Checks whether meta is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 78 of file keyevent.h.

References FIFE::InputEvent::isMetaPressed().

◆ isNumericPad()

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

Definition at line 68 of file keyevent.h.

References m_isNumericPad.

◆ isShiftPressed()

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

Checks whether shift is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 80 of file keyevent.h.

References FIFE::InputEvent::isShiftPressed().

◆ setAltPressed()

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

Sets alt to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 75 of file keyevent.h.

References FIFE::InputEvent::setAltPressed().

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

+ Here is the caller graph for this function:

◆ setControlPressed()

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

Sets control to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 77 of file keyevent.h.

References FIFE::InputEvent::setControlPressed().

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

+ Here is the caller graph for this function:

◆ setKey()

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

Definition at line 72 of file keyevent.h.

References m_key.

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

+ Here is the caller graph for this function:

◆ setMetaPressed()

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

Sets meta to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 79 of file keyevent.h.

References FIFE::InputEvent::setMetaPressed().

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

+ Here is the caller graph for this function:

◆ setNumericPad()

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

Definition at line 69 of file keyevent.h.

References m_isNumericPad.

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

+ Here is the caller graph for this function:

◆ setShiftPressed()

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

Sets shift to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 81 of file keyevent.h.

References FIFE::InputEvent::setShiftPressed().

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

+ Here is the caller graph for this function:

◆ setSource()

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

Sets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 88 of file keyevent.h.

References FIFE::InputEvent::setSource().

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

+ Here is the caller graph for this function:

◆ setTimeStamp()

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 keyevent.h.

References FIFE::InputEvent::setTimeStamp().

◆ setType()

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

Definition at line 66 of file keyevent.h.

References m_eventType.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_eventType

KeyEventType FIFE::KeyEvent::m_eventType
private

Definition at line 99 of file keyevent.h.

Referenced by getType(), and setType().

◆ m_isNumericPad

bool FIFE::KeyEvent::m_isNumericPad
private

Definition at line 100 of file keyevent.h.

Referenced by isNumericPad(), and setNumericPad().

◆ m_key

Key FIFE::KeyEvent::m_key
private

Definition at line 101 of file keyevent.h.

Referenced by getKey(), and setKey().


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