GameWindow.Mouse/Keyboard hide OpenTK.Input.Mouse/Keyboard.
To simplify usage, the former now provide the same methods
as the latter.
#region Keyboard
+ #pragma warning disable 0612
+
/// <summary>
/// Gets the primary Keyboard device, or null if no Keyboard exists.
/// </summary>
- [Obsolete("Use KeyDown, KeyUp and KeyPress events or OpenTK.Input.Keyboard instead.")]
public KeyboardDevice Keyboard
{
get { return InputDriver.Keyboard.Count > 0 ? InputDriver.Keyboard[0] : null; }
}
+ #pragma warning restore 0612
+
#endregion
#region Mouse
+ #pragma warning disable 0612
+
/// <summary>
/// Gets the primary Mouse device, or null if no Mouse exists.
/// </summary>
- [Obsolete("Use MouseMove, MouseDown, MouseUp and MouseWheel events or OpenTK.Input.Mouse, instead.")]
public MouseDevice Mouse
{
get { return InputDriver.Mouse.Count > 0 ? InputDriver.Mouse[0] : null; }
}
+ #pragma warning restore 0612
+
#endregion
#region --- GameWindow Timing ---
#region --- Public Methods ---
+ /// <summary>
+ /// Retrieves the combined <see cref="OpenTK.Input.KeyboardState"/> for all keyboard devices.
+ /// This method is equivalent to <see cref="OpenTK.Input.Keyboard.GetState()"/>.
+ /// </summary>
+ /// <returns>An <see cref="OpenTK.Input.KeyboardState"/> structure containing the combined state for all keyboard devices.</returns>
+ /// <seealso cref="OpenTK.Input.Keyboard.GetState()"/>
+ public KeyboardState GetState()
+ {
+ return Keyboard.GetState();
+ }
+
+ /// <summary>
+ /// Retrieves the <see cref="OpenTK.Input.KeyboardState"/> for the specified keyboard device.
+ /// This method is equivalent to <see cref="OpenTK.Input.Keyboard.GetState(int)"/>.
+ /// </summary>
+ /// <param name="index">The index of the keyboard device.</param>
+ /// <returns>An <see cref="OpenTK.Input.KeyboardState"/> structure containing the combined state for all keyboard devices.</returns>
+ /// <seealso cref="OpenTK.Input.Keyboard.GetState(int)"/>
+ public KeyboardState GetState(int index)
+ {
+ return Keyboard.GetState(index);
+ }
+
/// <summary>Returns the hash code for this KeyboardDevice.</summary>
/// <returns>A 32-bit signed integer hash code.</returns>
public override int GetHashCode()
#region --- Public Members ---
+ /// <summary>
+ /// Retrieves the combined hardware <see cref="OpenTK.Input.MouseState"/> for all specified mouse devices.
+ /// This method is equivalent to <see cref="OpenTK.Input.Mouse.GetState()"/>.
+ /// </summary>
+ /// <returns>A <see cref="OpenTK.Input.MouseState"/> structure representing the state for the specified mouse device.</returns>
+ /// <seealso cref="OpenTK.Input.Mouse.GetState()"/>
+ public MouseState GetState()
+ {
+ return Mouse.GetState();
+ }
+
+ /// <summary>
+ /// Retrieves the hardware <see cref="OpenTK.Input.MouseState"/> for the specified mouse device.
+ /// This method is equivalent to <see cref="OpenTK.Input.Mouse.GetState(int)"/>.
+ /// </summary>
+ /// <param name="index">The index of the mouse device.</param>
+ /// <returns>A <see cref="OpenTK.Input.MouseState"/> structure representing the state for the specified mouse device.</returns>
+ /// <seealso cref="OpenTK.Input.Mouse.GetState(int)"/>
+ public MouseState GetState(int index)
+ {
+ return Mouse.GetState(index);
+ }
+
+ /// <summary>
+ /// Retreves the <see cref="OpenTK.Input.MouseState"/> for the mouse cursor.
+ /// This method is equivalent to <see cref="OpenTK.Input.Mouse.GetCursorState"/>.
+ /// </summary>
+ /// <returns>A <see cref="OpenTK.Input.MouseState"/> structure representing the state of the mouse cursor.</returns>
+ /// <seealso cref="OpenTK.Input.Mouse.GetCursorState()"/>
+ public MouseState GetCursorState()
+ {
+ return Mouse.GetCursorState();
+ }
+
#region public int NumberOfButtons
/// <summary>