Former-commit-id: 90e7b45bfa2ff0efaad03de9f8149b27d1de2059 [formerly 39c8a91094eee32da25ec9f46534552271befd30] [formerly 73bdf966290144c9d18ceb228c88d60d143f0b2f [formerly 7e2aefa781168e192b4ae15f6f8f34ba3ab484fa]] Former-commit-id: 67231fa9b439ea294b3f1e4f7cfe5888663978e3 [formerly 975ca5d0d4ff41d858643b824036fa6818551698] Former-commit-id: ef88d5479c2f2637b213caff7923e444cc4b143d
85 lines
1.8 KiB
C++
85 lines
1.8 KiB
C++
// Copyright (C) 2015 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine - Utility module"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
#include <Nazara/Utility/EventHandler.hpp>
|
|
#include <memory>
|
|
#include <Nazara/Utility/Debug.hpp>
|
|
|
|
namespace Nz
|
|
{
|
|
inline EventHandler::EventHandler(const EventHandler&)
|
|
{
|
|
}
|
|
|
|
inline void EventHandler::Dispatch(const WindowEvent& event)
|
|
{
|
|
OnEvent(this, event);
|
|
|
|
switch (event.type)
|
|
{
|
|
case WindowEventType_GainedFocus:
|
|
OnGainedFocus(this);
|
|
break;
|
|
|
|
case WindowEventType_KeyPressed:
|
|
OnKeyPressed(this, event.key);
|
|
break;
|
|
|
|
case WindowEventType_KeyReleased:
|
|
OnKeyReleased(this, event.key);
|
|
break;
|
|
|
|
case WindowEventType_LostFocus:
|
|
OnLostFocus(this);
|
|
break;
|
|
|
|
case WindowEventType_MouseButtonDoubleClicked:
|
|
OnMouseButtonDoubleClicked(this, event.mouseButton);
|
|
break;
|
|
|
|
case WindowEventType_MouseButtonPressed:
|
|
OnMouseButtonPressed(this, event.mouseButton);
|
|
break;
|
|
|
|
case WindowEventType_MouseButtonReleased:
|
|
OnMouseButtonReleased(this, event.mouseButton);
|
|
break;
|
|
|
|
case WindowEventType_MouseEntered:
|
|
OnMouseEntered(this);
|
|
break;
|
|
|
|
case WindowEventType_MouseLeft:
|
|
OnMouseLeft(this);
|
|
break;
|
|
|
|
case WindowEventType_MouseMoved:
|
|
OnMouseMoved(this, event.mouseMove);
|
|
break;
|
|
|
|
case WindowEventType_MouseWheelMoved:
|
|
OnMouseWheelMoved(this, event.mouseWheel);
|
|
break;
|
|
|
|
case WindowEventType_Moved:
|
|
OnMoved(this, event.position);
|
|
break;
|
|
|
|
case WindowEventType_Quit:
|
|
OnQuit(this);
|
|
break;
|
|
|
|
case WindowEventType_Resized:
|
|
OnResized(this, event.size);
|
|
break;
|
|
|
|
case WindowEventType_TextEntered:
|
|
OnTextEntered(this, event.text);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
#include <Nazara/Utility/DebugOff.hpp>
|