Mercurial > fife-parpg
comparison engine/core/eventchannel/base/ec_inputevent.h @ 2:e84dccee1bb7
* add myself to authors
* fix missing break in guimanager
* when an event occurs over an guichan window the event is marked as consumedByGuichan, but the event is still distributed to all event listeners, those can check via event.isConsumedByGuichan...
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 01 Jul 2008 17:43:35 +0000 |
parents | 4a0efb7baf70 |
children | 6387bbc0c2d5 |
comparison
equal
deleted
inserted
replaced
1:2082bf27a3b8 | 2:e84dccee1bb7 |
---|---|
43 public: | 43 public: |
44 /** Constructor. | 44 /** Constructor. |
45 */ | 45 */ |
46 InputEvent(): | 46 InputEvent(): |
47 Event(), | 47 Event(), |
48 m_consumedbyguichan(false), | |
48 m_isshiftpressed(false), | 49 m_isshiftpressed(false), |
49 m_iscontrolpressed(false), | 50 m_iscontrolpressed(false), |
50 m_isaltpressed(false), | 51 m_isaltpressed(false), |
51 m_ismetapressed(false) {}; | 52 m_ismetapressed(false) {}; |
52 | 53 |
71 | 72 |
72 /** Checks whether shift is pressed. | 73 /** Checks whether shift is pressed. |
73 */ | 74 */ |
74 virtual bool isShiftPressed() const { return m_isshiftpressed; } | 75 virtual bool isShiftPressed() const { return m_isshiftpressed; } |
75 virtual void setShiftPressed(bool pressed) { m_isshiftpressed = pressed; } | 76 virtual void setShiftPressed(bool pressed) { m_isshiftpressed = pressed; } |
77 | |
78 /** Marks events as consumed by guichan. | |
79 */ | |
80 virtual void consumedByGuichan() { m_consumedbyguichan = true; } | |
81 virtual bool isConsumedByGuichan() const { return m_consumedbyguichan; } | |
76 | 82 |
77 virtual void consume() { Event::consume(); } | 83 virtual void consume() { Event::consume(); } |
78 virtual bool isConsumed() const { return Event::isConsumed(); } | 84 virtual bool isConsumed() const { return Event::isConsumed(); } |
79 virtual IEventSource* getSource() { return Event::getSource(); } | 85 virtual IEventSource* getSource() { return Event::getSource(); } |
80 virtual void setSource(IEventSource* source) { Event::setSource(source); } | 86 virtual void setSource(IEventSource* source) { Event::setSource(source); } |
99 return ss.str(); | 105 return ss.str(); |
100 } | 106 } |
101 | 107 |
102 | 108 |
103 private: | 109 private: |
110 bool m_consumedbyguichan; | |
104 bool m_isshiftpressed; | 111 bool m_isshiftpressed; |
105 bool m_iscontrolpressed; | 112 bool m_iscontrolpressed; |
106 bool m_isaltpressed; | 113 bool m_isaltpressed; |
107 bool m_ismetapressed; | 114 bool m_ismetapressed; |
108 }; | 115 }; |