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 bb84178f20
commit e49b1beb7b

View file

@ -29,9 +29,7 @@ namespace OpenTK.Input
#region --- Constructors ---
public KeyboardDevice()
{
}
internal KeyboardDevice() { }
#endregion
@ -125,11 +123,17 @@ namespace OpenTK.Input
#endregion
#region public event KeyDownEvent KeyDown;
/// <summary>
/// Occurs when a key is pressed.
/// </summary>
public event KeyDownEvent KeyDown;
#endregion
#region public event KeyUpEvent KeyUp;
/// <summary>
/// Occurs when a key is released.
/// </summary>
@ -137,6 +141,8 @@ namespace OpenTK.Input
#endregion
#endregion
#region --- IInputDevice Members ---
public string Description
@ -154,12 +160,18 @@ namespace OpenTK.Input
#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()
{
//return base.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()
{
//return base.ToString();
@ -168,6 +180,20 @@ namespace OpenTK.Input
}
#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);
@ -277,7 +303,7 @@ namespace OpenTK.Input
KeypadSubtract,
KeypadAdd,
KeypadDecimal,
//KeypadEnter,
KeypadEnter,
// Letters
A, B, C, D, E, F, G,