OMK::Inp::EscListener Class Reference
[User inputs]

Input listener for escape key. More...

#include <OMKEscListener.h>

Inheritance diagram for OMK::Inp::EscListener:

Inheritance graph
[legend]
Collaboration diagram for OMK::Inp::EscListener:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 EscListener (ExtensibleSimulatedObject *sender, const Name &id)
virtual ~EscListener ()
virtual bool keyPressed (const OIS::KeyEvent &e)
 Dispatches key pressed event.
virtual bool keyReleased (const OIS::KeyEvent &e)
 Dispatches key released event.

Detailed Description

Input listener for escape key.

Date:
2007-03-12
Author:
Benoît Chanclou
Module description :
This listener sends the stop signal (SystemEventIdentifier::MaskStop) which stop the simulation on the escape key pressing.

To add this listener you don't have to declare it as an input listener, see ExitOnEsc parameter in InputExtension for more details.

Definition at line 43 of file OMKEscListener.h.


Constructor & Destructor Documentation

EscListener::EscListener ( ExtensibleSimulatedObject sender,
const Name id 
)

Definition at line 9 of file OMKEscListener.cpp.

00010 : InputListener( sender, id, 0 )
00011 {
00012 }

EscListener::~EscListener (  )  [virtual]

Definition at line 14 of file OMKEscListener.cpp.

00015 {
00016 }


Member Function Documentation

bool EscListener::keyPressed ( const OIS::KeyEvent &  e  )  [virtual]

Dispatches key pressed event.

Definition at line 18 of file OMKEscListener.cpp.

References OMK::Inp::InputListener::_sender, OMK::SimulatedObject::getController(), OMK::SimulatedObject::getName(), OMK::SystemEventIdentifier::MaskStop, and OMK::SimulatedObject::sendEvent().

00019 {
00020   if( OIS::KC_ESCAPE == e.key )
00021   {
00022     _sender->sendEvent( _sender->getController().getName(), 
00023                               SystemEventIdentifier::MaskStop ) ;
00024   }
00025   return true ;
00026 }

virtual bool OMK::Inp::EscListener::keyReleased ( const OIS::KeyEvent &  e  )  [inline, virtual]

Dispatches key released event.

Definition at line 54 of file OMKEscListener.h.

00054 { return true ; }


logo OpenMask

Documentation generated on Mon Jun 9 11:46:04 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007