#include <OMKEscListener.h>
Inheritance diagram for OMK::Inp::EscListener:
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. |
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.
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] |
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] |
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |