diff --git a/Source/Examples/WinForms/W01_First_Window.cs b/Source/Examples/WinForms/W01_First_Window.cs index 1bbafb77..5222c6c6 100644 --- a/Source/Examples/WinForms/W01_First_Window.cs +++ b/Source/Examples/WinForms/W01_First_Window.cs @@ -23,7 +23,7 @@ namespace Examples.WinForms { public partial class W01_First_Window : Form, IExample { - OpenTK.InputDevices input; + OpenTK.InputDriver input; public W01_First_Window() { InitializeComponent(); @@ -35,7 +35,7 @@ namespace Examples.WinForms { base.OnHandleCreated(e); - input = new OpenTK.InputDevices(this.Handle); + input = new OpenTK.InputDriver(this.Handle); } private void redButton_Click(object sender, EventArgs e) diff --git a/Source/OpenTK/GameWindow.cs b/Source/OpenTK/GameWindow.cs index 582a1f19..4d298862 100644 --- a/Source/OpenTK/GameWindow.cs +++ b/Source/OpenTK/GameWindow.cs @@ -19,14 +19,14 @@ namespace OpenTK private ResizeEventArgs resizeEventArgs = new ResizeEventArgs(); private DisplayMode mode; - private InputDevices inputDevices; - public IList Keyboard { get { return Input.Keyboards; } } - public InputDevices Input + private InputDriver inputDevices; + public IList Keyboard { get { return Input.Keyboard; } } + public InputDriver Input { get { if (inputDevices == null) - inputDevices = new InputDevices(this.Handle); + inputDevices = new InputDriver(this.Handle); return inputDevices; } } @@ -64,7 +64,7 @@ namespace OpenTK void glWindow_Create(object sender, EventArgs e) { //glWindow.Context.MakeCurrent(); - inputDevices = new InputDevices(this.Handle); + inputDevices = new InputDriver(this.Handle); this.OnCreate(e); } diff --git a/Source/OpenTK/Input/IInputDriver.cs b/Source/OpenTK/Input/IInputDriver.cs index e5ce824c..89c73c7b 100644 --- a/Source/OpenTK/Input/IInputDriver.cs +++ b/Source/OpenTK/Input/IInputDriver.cs @@ -4,7 +4,7 @@ using System.Text; namespace OpenTK.Input { - public interface IInputDriver : IKeyboardDriver + public interface IInputDriver : IKeyboardDriver, IMouseDriver { IList InputDevices { get; } //void ProcessEvents diff --git a/Source/OpenTK/Input/IKeyboardDriver.cs b/Source/OpenTK/Input/IKeyboardDriver.cs index ac1b9caf..688e18b9 100644 --- a/Source/OpenTK/Input/IKeyboardDriver.cs +++ b/Source/OpenTK/Input/IKeyboardDriver.cs @@ -6,6 +6,6 @@ namespace OpenTK.Input { public interface IKeyboardDriver { - IList Keyboards { get; } + IList Keyboard { get; } } } diff --git a/Source/OpenTK/InputDevices.cs b/Source/OpenTK/InputDriver.cs similarity index 71% rename from Source/OpenTK/InputDevices.cs rename to Source/OpenTK/InputDriver.cs index ff3efbc5..9f29ec0d 100644 --- a/Source/OpenTK/InputDevices.cs +++ b/Source/OpenTK/InputDriver.cs @@ -6,11 +6,11 @@ using OpenTK.Input; namespace OpenTK { - public class InputDevices : IInputDriver + public class InputDriver : IInputDriver { IInputDriver inputDriver; - public InputDevices(IntPtr parentHandle) + public InputDriver(IntPtr parentHandle) { if (Environment.OSVersion.Version.Major > 5 || (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1)) @@ -30,9 +30,14 @@ namespace OpenTK get { return inputDriver.InputDevices; } } - public IList Keyboards + public IList Keyboard { - get { return inputDriver.Keyboards; } + get { return inputDriver.Keyboard; } + } + + public IList Mouse + { + get { throw new NotImplementedException(); } } #endregion diff --git a/Source/OpenTK/Platform/Windows/WinRawInput.cs b/Source/OpenTK/Platform/Windows/WinRawInput.cs index 3a52a921..cccfdb11 100644 --- a/Source/OpenTK/Platform/Windows/WinRawInput.cs +++ b/Source/OpenTK/Platform/Windows/WinRawInput.cs @@ -153,9 +153,14 @@ namespace OpenTK.Platform.Windows get { throw new Exception("The method or operation is not implemented."); } } - public IList Keyboards + public IList Keyboard { - get { return keyboardDriver.Keyboards; } + get { return keyboardDriver.Keyboard; } + } + + public IList Mouse + { + get { throw new Exception("The method or operation is not implemented."); } } #endregion diff --git a/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs b/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs index d3642d0f..7dd91ab3 100644 --- a/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs +++ b/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs @@ -332,7 +332,7 @@ namespace OpenTK.Platform.Windows #region --- IKeyboardDriver Members --- - public IList Keyboards + public IList Keyboard { get { return keyboards; } } diff --git a/Source/OpenTK/Platform/Windows/WinRawMouse.cs b/Source/OpenTK/Platform/Windows/WinRawMouse.cs new file mode 100644 index 00000000..8ac0ae86 --- /dev/null +++ b/Source/OpenTK/Platform/Windows/WinRawMouse.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenTK.Platform.Windows +{ + class WinRawMouse + { + } +}