Added internal ClearKeys method. Made the constructor internal. Added docs to a few functions.

This commit is contained in:
the_fiddler 2008-03-10 08:49:48 +00:00
parent bc1801d5d5
commit b04606640f

View file

@ -29,9 +29,7 @@ namespace OpenTK.Input
#region --- Constructors --- #region --- Constructors ---
public KeyboardDevice() internal KeyboardDevice() { }
{
}
#endregion #endregion
@ -125,11 +123,17 @@ namespace OpenTK.Input
#endregion #endregion
#region public event KeyDownEvent KeyDown;
/// <summary> /// <summary>
/// Occurs when a key is pressed. /// Occurs when a key is pressed.
/// </summary> /// </summary>
public event KeyDownEvent KeyDown; public event KeyDownEvent KeyDown;
#endregion
#region public event KeyUpEvent KeyUp;
/// <summary> /// <summary>
/// Occurs when a key is released. /// Occurs when a key is released.
/// </summary> /// </summary>
@ -137,6 +141,8 @@ namespace OpenTK.Input
#endregion #endregion
#endregion
#region --- IInputDevice Members --- #region --- IInputDevice Members ---
public string Description public string Description
@ -154,12 +160,18 @@ namespace OpenTK.Input
#region --- Public Methods --- #region --- Public Methods ---
/// <summary>Returns the hash code for this KeyboardDevice.</summary>
/// <returns>A 32-bit signed integer hash code.</returns>
public override int GetHashCode() public override int GetHashCode()
{ {
//return base.GetHashCode(); //return base.GetHashCode();
return (int)(numKeys ^ numFKeys ^ numLeds ^ devID.GetHashCode() ^ description.GetHashCode()); return (int)(numKeys ^ numFKeys ^ numLeds ^ devID.GetHashCode() ^ description.GetHashCode());
} }
/// <summary>
/// Returns a System.String representing this KeyboardDevice.
/// </summary>
/// <returns>A System.String representing this KeyboardDevice.</returns>
public override string ToString() public override string ToString()
{ {
//return base.ToString(); //return base.ToString();
@ -168,6 +180,20 @@ namespace OpenTK.Input
} }
#endregion #endregion
#region --- Internal Methods ---
#region internal void ClearKeys()
internal void ClearKeys()
{
for (int i = 0; i < (int)Key.MaxKeys; i++)
this[(Key)i] = false;
}
#endregion
#endregion
} }
public delegate void KeyDownEvent(KeyboardDevice sender, Key key); public delegate void KeyDownEvent(KeyboardDevice sender, Key key);
@ -277,7 +303,7 @@ namespace OpenTK.Input
KeypadSubtract, KeypadSubtract,
KeypadAdd, KeypadAdd,
KeypadDecimal, KeypadDecimal,
//KeypadEnter, KeypadEnter,
// Letters // Letters
A, B, C, D, E, F, G, A, B, C, D, E, F, G,