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-07 07:12:46 +00:00
|
|
|
// $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"
|
|
|
|
|
2005-08-07 07:12:46 +00:00
|
|
|
#include "Application.hpp"
|
2005-07-19 05:45:22 +00:00
|
|
|
|
|
|
|
namespace photon
|
|
|
|
{
|
|
|
|
|
|
|
|
InputListener::InputListener() :
|
|
|
|
active_(true)
|
|
|
|
{
|
2005-08-07 07:12:46 +00:00
|
|
|
Application::addInputListener(this);
|
2005-07-19 05:45:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
InputListener::~InputListener()
|
|
|
|
{
|
2005-08-07 07:12:46 +00:00
|
|
|
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) { }
|
|
|
|
|
|
|
|
|
|
|
|
}
|