@@ -70,7 +70,7 @@ public KeyboardState(params Keys[] keys)
7070 {
7171 foreach ( Keys k in keys )
7272 {
73- InternalSetKey ( k ) ;
73+ AddPressedKey ( ( int ) k ) ;
7474 }
7575 }
7676 }
@@ -98,7 +98,7 @@ internal KeyboardState(List<Keys> keys)
9898 {
9999 foreach ( Keys k in keys )
100100 {
101- InternalSetKey ( k ) ;
101+ AddPressedKey ( ( int ) k ) ;
102102 }
103103 }
104104 }
@@ -213,9 +213,13 @@ bool InternalGetKey(Keys key)
213213 return ( element & mask ) != 0 ;
214214 }
215215
216- void InternalSetKey ( Keys key )
216+ /* Nuclex.Input uses reflection to get this method.
217+ * Keep this name as it is for XNA4 accuracy!
218+ * -flibit
219+ */
220+ void AddPressedKey ( int key )
217221 {
218- uint mask = ( uint ) 1 << ( ( ( int ) key ) & 0x1f ) ;
222+ uint mask = ( uint ) 1 << ( key & 0x1f ) ;
219223 switch ( ( ( int ) key ) >> 5 )
220224 {
221225 case 0 : keys0 |= mask ; break ;
@@ -229,10 +233,14 @@ void InternalSetKey(Keys key)
229233 }
230234 }
231235
232- void InternalClearKey ( Keys key )
236+ /* Nuclex.Input uses reflection to get this method.
237+ * Keep this name as it is for XNA4 accuracy!
238+ * -flibit
239+ */
240+ void RemovePressedKey ( int key )
233241 {
234- uint mask = ( uint ) 1 << ( ( ( int ) key ) & 0x1f ) ;
235- switch ( ( ( int ) key ) >> 5 )
242+ uint mask = ( uint ) 1 << ( key & 0x1f ) ;
243+ switch ( key >> 5 )
236244 {
237245 case 0 : keys0 &= ~ mask ; break ;
238246 case 1 : keys1 &= ~ mask ; break ;
@@ -245,30 +253,6 @@ void InternalClearKey(Keys key)
245253 }
246254 }
247255
248- void InternalClearAllKeys ( )
249- {
250- keys0 = 0 ;
251- keys1 = 0 ;
252- keys2 = 0 ;
253- keys3 = 0 ;
254- keys4 = 0 ;
255- keys5 = 0 ;
256- keys6 = 0 ;
257- keys7 = 0 ;
258- }
259-
260- void AddPressedKey ( int key )
261- {
262- // non-public method used by Nuclex.Input library in Revolver360 Re:Actor
263- InternalSetKey ( ( Keys ) key ) ;
264- }
265-
266- void RemovePressedKey ( int key )
267- {
268- // non-public method used by Nuclex.Input library in Revolver360 Re:Actor
269- InternalClearKey ( ( Keys ) key ) ;
270- }
271-
272256 #endregion
273257
274258 #region Public Static Operators and Override Methods
0 commit comments