From b013c0d26e0d142c3ec3de57e64ae42dfe0d163a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 20 Nov 2012 14:15:37 +0100 Subject: [PATCH] Sdl2Application: proper implementation of event accepting/rejecting. It actually IS useful for event propagation. --- src/Platform/Sdl2Application.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index 996a780b8..6118890b9 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -212,23 +212,21 @@ class Sdl2Application::InputEvent { /** * @brief Set event as accepted * - * Does nothing. Included only for compatibility with - * NaClApplication::InputEvent. + * If the event is ignored (i.e., not set as accepted), it might be + * 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 - * - * Always returns true. Included only for compatibility with - * NaClApplication::InputEvent. - */ - inline bool isAccepted() const { return true; } + /** @brief Whether the event is accepted */ + inline bool isAccepted() { return _accepted; } #ifndef DOXYGEN_GENERATING_OUTPUT protected: - inline InputEvent() {} + inline InputEvent(): _accepted(false) {} #endif + + private: + bool _accepted; }; /** @@ -390,7 +388,7 @@ class Sdl2Application::MouseMoveEvent: public Sdl2Application::InputEvent { /** * @brief Relative position * - * Position relative to previous event + * Position relative to previous event. */ inline Math::Vector2 relativePosition() const { return _relativePosition; }