1
Vote

Keyboard keyDown null at start

description

I've got the follow exception when using the keyboard in the main loop.
 
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
StackTrace:
   at Microsoft.Xna.Framework.Input.KeyboardState.IsKeyDown(Keys key)
   at Haiku.Keyboard.IsReleased(Keys key)
   at Haiku.Debug.Statistics.Update()
   at Haiku.HaikuGame.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.gameLoop_Update(Object sender, SimpleEventArgs`1 e)
   at SilverArcade.SilverSprite.GameLoop.CompositionTarget_Rendering(Object sender, EventArgs e)
   at System.Windows.Media.CompositionTarget.OnRendering(Object sender, RenderingEventArgs e)
   at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)
InnerException:

comments