cpp_photon/src/InputListener.cpp

47 lines
946 B
C++
Raw Normal View History

2005-07-19 05:45:22 +00:00
//This file is part of Photon (http://photon.sourceforge.net)
//Copyright (C) 2004-2005 James Turk
//
// Author:
// James Turk (jpt2433@rit.edu)
//
// Version:
2005-08-08 19:19:21 +00:00
// $Id: InputListener.cpp,v 1.3 2005/08/08 19:19:22 cozman Exp $
2005-07-19 05:45:22 +00:00
#include "InputListener.hpp"
#include "Application.hpp"
2005-07-19 05:45:22 +00:00
namespace photon
{
InputListener::InputListener() :
active_(true)
{
Application::addInputListener(this);
2005-07-19 05:45:22 +00:00
}
InputListener::~InputListener()
{
Application::removeInputListener(this);
2005-07-19 05:45:22 +00:00
}
void InputListener::setActive(bool active)
{
active_ = active;
}
bool InputListener::isActive() const
{
return active_;
}
// do nothing, overloaded as needed
2005-08-08 19:19:21 +00:00
void InputListener::onKeyPress(KeyCode key) { }
void InputListener::onKeyRelease(KeyCode key) { }
void InputListener::onMouseButtonPress(MouseButton button) { }
void InputListener::onMouseButtonRelease(MouseButton button) { }
2005-07-19 05:45:22 +00:00
void InputListener::onMouseMove(const math::Vector2& pos) { }
}