Renamed InputDevices.cs to InputDriver.cs.

Added IMouseDriver.cs and WinRawMouse.
This commit is contained in:
the_fiddler 2007-08-04 13:28:16 +00:00
parent f9ab9f5242
commit 6812739418
8 changed files with 36 additions and 16 deletions

View file

@ -23,7 +23,7 @@ namespace Examples.WinForms
{ {
public partial class W01_First_Window : Form, IExample public partial class W01_First_Window : Form, IExample
{ {
OpenTK.InputDevices input; OpenTK.InputDriver input;
public W01_First_Window() public W01_First_Window()
{ {
InitializeComponent(); InitializeComponent();
@ -35,7 +35,7 @@ namespace Examples.WinForms
{ {
base.OnHandleCreated(e); base.OnHandleCreated(e);
input = new OpenTK.InputDevices(this.Handle); input = new OpenTK.InputDriver(this.Handle);
} }
private void redButton_Click(object sender, EventArgs e) private void redButton_Click(object sender, EventArgs e)

View file

@ -19,14 +19,14 @@ namespace OpenTK
private ResizeEventArgs resizeEventArgs = new ResizeEventArgs(); private ResizeEventArgs resizeEventArgs = new ResizeEventArgs();
private DisplayMode mode; private DisplayMode mode;
private InputDevices inputDevices; private InputDriver inputDevices;
public IList<Input.Keyboard> Keyboard { get { return Input.Keyboards; } } public IList<Input.Keyboard> Keyboard { get { return Input.Keyboard; } }
public InputDevices Input public InputDriver Input
{ {
get get
{ {
if (inputDevices == null) if (inputDevices == null)
inputDevices = new InputDevices(this.Handle); inputDevices = new InputDriver(this.Handle);
return inputDevices; return inputDevices;
} }
} }
@ -64,7 +64,7 @@ namespace OpenTK
void glWindow_Create(object sender, EventArgs e) void glWindow_Create(object sender, EventArgs e)
{ {
//glWindow.Context.MakeCurrent(); //glWindow.Context.MakeCurrent();
inputDevices = new InputDevices(this.Handle); inputDevices = new InputDriver(this.Handle);
this.OnCreate(e); this.OnCreate(e);
} }

View file

@ -4,7 +4,7 @@ using System.Text;
namespace OpenTK.Input namespace OpenTK.Input
{ {
public interface IInputDriver : IKeyboardDriver public interface IInputDriver : IKeyboardDriver, IMouseDriver
{ {
IList<IInputDevice> InputDevices { get; } IList<IInputDevice> InputDevices { get; }
//void ProcessEvents //void ProcessEvents

View file

@ -6,6 +6,6 @@ namespace OpenTK.Input
{ {
public interface IKeyboardDriver public interface IKeyboardDriver
{ {
IList<Keyboard> Keyboards { get; } IList<Keyboard> Keyboard { get; }
} }
} }

View file

@ -6,11 +6,11 @@ using OpenTK.Input;
namespace OpenTK namespace OpenTK
{ {
public class InputDevices : IInputDriver public class InputDriver : IInputDriver
{ {
IInputDriver inputDriver; IInputDriver inputDriver;
public InputDevices(IntPtr parentHandle) public InputDriver(IntPtr parentHandle)
{ {
if (Environment.OSVersion.Version.Major > 5 || if (Environment.OSVersion.Version.Major > 5 ||
(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1)) (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1))
@ -30,9 +30,14 @@ namespace OpenTK
get { return inputDriver.InputDevices; } get { return inputDriver.InputDevices; }
} }
public IList<Keyboard> Keyboards public IList<Keyboard> Keyboard
{ {
get { return inputDriver.Keyboards; } get { return inputDriver.Keyboard; }
}
public IList<Keyboard> Mouse
{
get { throw new NotImplementedException(); }
} }
#endregion #endregion

View file

@ -153,9 +153,14 @@ namespace OpenTK.Platform.Windows
get { throw new Exception("The method or operation is not implemented."); } get { throw new Exception("The method or operation is not implemented."); }
} }
public IList<Keyboard> Keyboards public IList<Keyboard> Keyboard
{ {
get { return keyboardDriver.Keyboards; } get { return keyboardDriver.Keyboard; }
}
public IList<Keyboard> Mouse
{
get { throw new Exception("The method or operation is not implemented."); }
} }
#endregion #endregion

View file

@ -332,7 +332,7 @@ namespace OpenTK.Platform.Windows
#region --- IKeyboardDriver Members --- #region --- IKeyboardDriver Members ---
public IList<Keyboard> Keyboards public IList<Keyboard> Keyboard
{ {
get { return keyboards; } get { return keyboards; }
} }

View file

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenTK.Platform.Windows
{
class WinRawMouse
{
}
}