cpp_photon/src/InputListener.cpp

47 lines
922 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:
// $Id: InputListener.cpp,v 1.2 2005/08/07 07:12:47 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
void InputListener::onKeyPress(int key) { }
void InputListener::onKeyRelease(int key) { }
void InputListener::onMouseButtonPress(int button) { }
void InputListener::onMouseButtonRelease(int button) { }
void InputListener::onMouseMove(const math::Vector2& pos) { }
}