Browse Source

Sdl2Application: proper implementation of event accepting/rejecting.

It actually IS useful for event propagation.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
b013c0d26e
  1. 22
      src/Platform/Sdl2Application.h

22
src/Platform/Sdl2Application.h

@ -212,23 +212,21 @@ class Sdl2Application::InputEvent {
/** /**
* @brief Set event as accepted * @brief Set event as accepted
* *
* Does nothing. Included only for compatibility with * If the event is ignored (i.e., not set as accepted), it might be
* NaClApplication::InputEvent. * propagated elsewhere. By default is each event ignored.
*/ */
inline void setAccepted(bool = true) {} inline void setAccepted(bool accepted = true) { _accepted = accepted; }
/** /** @brief Whether the event is accepted */
* @brief Whether the event is accepted inline bool isAccepted() { return _accepted; }
*
* Always returns true. Included only for compatibility with
* NaClApplication::InputEvent.
*/
inline bool isAccepted() const { return true; }
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
protected: protected:
inline InputEvent() {} inline InputEvent(): _accepted(false) {}
#endif #endif
private:
bool _accepted;
}; };
/** /**
@ -390,7 +388,7 @@ class Sdl2Application::MouseMoveEvent: public Sdl2Application::InputEvent {
/** /**
* @brief Relative position * @brief Relative position
* *
* Position relative to previous event * Position relative to previous event.
*/ */
inline Math::Vector2<int> relativePosition() const { return _relativePosition; } inline Math::Vector2<int> relativePosition() const { return _relativePosition; }

Loading…
Cancel
Save