FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::IKeyListener Class Referenceabstract

Listener of key events. More...

#include <ikeylistener.h>

+ Inheritance diagram for FIFE::IKeyListener:
+ Collaboration diagram for FIFE::IKeyListener:

Public Member Functions

virtual void keyPressed (KeyEvent &evt)=0
 Called if a key is pressed If a key is held down the multiple key presses are generated. More...
 
virtual void keyReleased (KeyEvent &evt)=0
 Called if a key is released. More...
 
virtual bool isGlobalListener () const
 Indicates if this is a global listener Global listener can also receive events that are consumed by widgets / gui. More...
 
virtual void setGlobalListener (bool global)
 Changes the behaviour of the listener to be global or not. More...
 
virtual ~IKeyListener ()
 
- Public Member Functions inherited from FIFE::IListener
virtual bool isActive ()
 Indicates if the listener is active. More...
 
virtual void setActive (bool active)
 Changes the listener status. More...
 
virtual ~IListener ()
 

Protected Member Functions

 IKeyListener ()
 
- Protected Member Functions inherited from FIFE::IListener
 IListener ()
 

Private Attributes

bool m_global
 

Detailed Description

Listener of key events.

To be able to listen for key events you must make a class which inherits from this class and implements its functions.

Definition at line 44 of file ikeylistener.h.

Constructor & Destructor Documentation

◆ ~IKeyListener()

virtual FIFE::IKeyListener::~IKeyListener ( )
inlinevirtual

Definition at line 69 of file ikeylistener.h.

◆ IKeyListener()

FIFE::IKeyListener::IKeyListener ( )
inlineprotected

Definition at line 72 of file ikeylistener.h.

References m_global.

Member Function Documentation

◆ isGlobalListener()

virtual bool FIFE::IKeyListener::isGlobalListener ( ) const
inlinevirtual

Indicates if this is a global listener Global listener can also receive events that are consumed by widgets / gui.

Default value is false.

Definition at line 61 of file ikeylistener.h.

References m_global.

◆ keyPressed()

virtual void FIFE::IKeyListener::keyPressed ( KeyEvent evt)
pure virtual

Called if a key is pressed If a key is held down the multiple key presses are generated.

Parameters
evtKeyEvent that describes the event.

◆ keyReleased()

virtual void FIFE::IKeyListener::keyReleased ( KeyEvent evt)
pure virtual

Called if a key is released.

Parameters
evtKeyEvent that describes the event.

◆ setGlobalListener()

virtual void FIFE::IKeyListener::setGlobalListener ( bool  global)
inlinevirtual

Changes the behaviour of the listener to be global or not.

Global listener can also receive events that are consumed by widgets / gui.

Parameters
globalThe value to change the behaviour of this listener.

Definition at line 67 of file ikeylistener.h.

References m_global.

Member Data Documentation

◆ m_global

bool FIFE::IKeyListener::m_global
private

Definition at line 75 of file ikeylistener.h.

Referenced by IKeyListener(), isGlobalListener(), and setGlobalListener().


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