From e49b1beb7b3d89b0d237f1eca530bea18458ea0f Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 10 Mar 2008 08:49:48 +0000 Subject: [PATCH] Added internal ClearKeys method. Made the constructor internal. Added docs to a few functions. --- Source/OpenTK/Input/KeyboardDevice.cs | 34 +++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/Source/OpenTK/Input/KeyboardDevice.cs b/Source/OpenTK/Input/KeyboardDevice.cs index ec52a16c..ac33361e 100644 --- a/Source/OpenTK/Input/KeyboardDevice.cs +++ b/Source/OpenTK/Input/KeyboardDevice.cs @@ -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; + /// /// Occurs when a key is pressed. /// public event KeyDownEvent KeyDown; + #endregion + + #region public event KeyUpEvent KeyUp; + /// /// Occurs when a key is released. /// @@ -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 --- + /// Returns the hash code for this KeyboardDevice. + /// A 32-bit signed integer hash code. public override int GetHashCode() { //return base.GetHashCode(); return (int)(numKeys ^ numFKeys ^ numLeds ^ devID.GetHashCode() ^ description.GetHashCode()); } + /// + /// Returns a System.String representing this KeyboardDevice. + /// + /// A System.String representing this KeyboardDevice. 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,