AnimaL |
Tutorial |
Documentation |
00001 00002 // keyEvent.h // 00004 00005 #ifndef ANIMAL_KEY_EVENT_H 00006 #define ANIMAL_KEY_EVENT_H 00007 00008 #include "event.h" 00009 00010 namespace animal{ 00011 00013 class KeyEvent : public Event 00014 { 00015 public: 00017 KeyEvent(TypeInt type, KeyInt key, ButtonStateInt state) 00018 : Event(type, state) 00019 , _accepted(false) 00020 , _key(key) 00021 {} 00023 virtual ~KeyEvent(){} 00025 KeyInt key() const { return _key; } 00027 bool isAccepted() const{ return _accepted; } 00029 void accept() { _accepted = true; } 00031 void ignore() { _accepted = false; } 00032 00033 protected : 00034 bool _accepted; 00035 KeyInt _key; 00036 00037 }; 00038 00039 }// animal 00040 00041 #endif