Opentk/Source/OpenTK/InputDevices.cs
the_fiddler 2f64fb372e Major updates to keyboard input. The infrastructure (drivers etc) is ready. Windows raw input works (now implementing multiple devices). The examples need updating for the new input methods.
Updated the ExampleLauncher to not process exceptions. Updated the IExample interface to contain the Launch method. Updated examples and the ExampleLauncher according to the IExample interface.
Synced with gl3 branch.
2007-08-03 00:14:31 +00:00

41 lines
1 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using OpenTK.Input;
namespace OpenTK
{
public class InputDevices : IInputDriver
{
IInputDriver inputDriver;
public InputDevices()
{
if (Environment.OSVersion.Version.Major > 5 ||
(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1))
{
inputDriver = new OpenTK.Platform.Windows.WinRawInput();
}
else
{
throw new PlatformNotSupportedException("Input is not implemented for platforms prior to Windows XP, yet.");
}
}
#region --- IInputDriver Members ---
IList<OpenTK.Input.IInputDevice> OpenTK.Input.IInputDriver.InputDevices
{
get { return inputDriver.InputDevices; }
}
public IList<OpenTK.Input.IKeyboard> Keyboards
{
get { return inputDriver.Keyboards; }
}
#endregion
}
}