2001-05-23 22:59:40 +00:00
|
|
|
// input.cxx -- handle user input from various sources.
|
|
|
|
//
|
|
|
|
// Written by David Megginson, started May 2001.
|
2009-08-07 18:56:48 +00:00
|
|
|
// Major redesign by Torsten Dreyer, started August 2009
|
2001-05-23 22:59:40 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2001 David Megginson, david@megginson.com
|
2009-08-07 18:56:48 +00:00
|
|
|
// Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de
|
2001-05-23 22:59:40 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2001-05-23 22:59:40 +00:00
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "input.hxx"
|
2009-08-07 18:56:48 +00:00
|
|
|
#include "FGMouseInput.hxx"
|
|
|
|
#include "FGKeyboardInput.hxx"
|
|
|
|
#include "FGJoystickInput.hxx"
|
2001-05-23 22:59:40 +00:00
|
|
|
|
2009-08-07 18:56:48 +00:00
|
|
|
#ifdef WITH_EVENTINPUT
|
2009-08-11 15:59:30 +00:00
|
|
|
#if defined( UL_WIN32 )
|
|
|
|
//to be developed
|
|
|
|
//#include "FGDirectXEventInput.hxx"
|
|
|
|
//#define INPUTEVENT_CLASS FGDirectXEventInput
|
|
|
|
#elif defined ( UL_MAC_OSX )
|
2009-08-28 15:05:21 +00:00
|
|
|
#include "FGMacOSXEventInput.hxx"
|
|
|
|
#define INPUTEVENT_CLASS FGMacOSXEventInput
|
2009-08-11 15:59:30 +00:00
|
|
|
#else
|
2009-08-07 18:56:48 +00:00
|
|
|
#include "FGLinuxEventInput.hxx"
|
2009-08-11 15:59:30 +00:00
|
|
|
#define INPUTEVENT_CLASS FGLinuxEventInput
|
|
|
|
#endif
|
|
|
|
|
2009-08-07 18:56:48 +00:00
|
|
|
#endif
|
2008-04-25 23:21:47 +00:00
|
|
|
|
2001-05-23 22:59:40 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Implementation of FGInput.
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
2009-08-07 18:56:48 +00:00
|
|
|
FGInput::FGInput ()
|
2001-05-23 22:59:40 +00:00
|
|
|
{
|
2009-08-07 18:56:48 +00:00
|
|
|
set_subsystem( "input-mouse", new FGMouseInput() );
|
|
|
|
set_subsystem( "input-keyboard", new FGKeyboardInput() );
|
|
|
|
set_subsystem( "input-joystick", new FGJoystickInput() );
|
2009-08-11 15:59:30 +00:00
|
|
|
#ifdef INPUTEVENT_CLASS
|
|
|
|
set_subsystem( "input-event", new INPUTEVENT_CLASS() );
|
|
|
|
#endif
|
2001-05-23 22:59:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FGInput::~FGInput ()
|
|
|
|
{
|
2009-08-07 18:56:48 +00:00
|
|
|
// SGSubsystemGroup deletes all subsystem in it's destructor
|
2001-08-10 05:17:40 +00:00
|
|
|
}
|
|
|
|
|