2007-08-03 02:14:31 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
using OpenTK.Input;
|
|
|
|
|
|
|
|
|
|
namespace OpenTK
|
|
|
|
|
{
|
2007-08-04 15:28:16 +02:00
|
|
|
|
public class InputDriver : IInputDriver
|
2007-08-03 02:14:31 +02:00
|
|
|
|
{
|
|
|
|
|
IInputDriver inputDriver;
|
|
|
|
|
|
2007-08-04 15:28:16 +02:00
|
|
|
|
public InputDriver(IntPtr parentHandle)
|
2007-08-03 02:14:31 +02:00
|
|
|
|
{
|
|
|
|
|
if (Environment.OSVersion.Version.Major > 5 ||
|
|
|
|
|
(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1))
|
|
|
|
|
{
|
2007-08-04 14:09:58 +02:00
|
|
|
|
inputDriver = new OpenTK.Platform.Windows.WinRawInput(parentHandle);
|
2007-08-03 02:14:31 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new PlatformNotSupportedException("Input is not implemented for platforms prior to Windows XP, yet.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region --- IInputDriver Members ---
|
|
|
|
|
|
2007-08-04 14:09:58 +02:00
|
|
|
|
IList<IInputDevice> IInputDriver.InputDevices
|
2007-08-03 02:14:31 +02:00
|
|
|
|
{
|
|
|
|
|
get { return inputDriver.InputDevices; }
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-04 15:28:16 +02:00
|
|
|
|
public IList<Keyboard> Keyboard
|
2007-08-03 02:14:31 +02:00
|
|
|
|
{
|
2007-08-04 15:28:16 +02:00
|
|
|
|
get { return inputDriver.Keyboard; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IList<Keyboard> Mouse
|
|
|
|
|
{
|
|
|
|
|
get { throw new NotImplementedException(); }
|
2007-08-03 02:14:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|