Keyboard Mapping in v0.9.1

Jan 6, 2012 at 8:01 PM

Hello Philippe,

Great work on the framework!
I'm using the latest binaries from the downloads area and for whatever reason I don't see keyboard mappings anymore.  Am I missing something?

Also I'm not sure where to plug feature requests but it would be nice to have a way to set the Camera's projection since I need to change field of view when I'm sniping in my game.

Thanks for your hard work!


Jan 6, 2012 at 8:19 PM

Nevermind on the projection bit.  I found that you are setting _isProjectionDirty if you modify a property.
So I'm good there, sorry about that! 

Jan 7, 2012 at 12:19 AM

Hi Nick,

Glad you got it by yourself ;)


Jan 7, 2012 at 12:24 AM

Thank you Philippe.  But I'm still stuck on the keyboard issue above.

Jan 7, 2012 at 1:28 AM

The Keyboad mappings are located on the PlayerInput instance retrieved from the InputManager.

If you want to set them on the Application.Initialize override, you'll want to make a call similar to this:

PlayerInput playerInputOne = Input.GetPlayerInput(PlayerIndex.One);
playerInputOne.UseKeyboardMouseInput = true;

playerInputOne.VirtualGamePadMapping.LeftStickLeft = Keys.Left;
playerInputOne.VirtualGamePadMapping.LeftStickForward = Keys.Up;
playerInputOne.VirtualGamePadMapping.LeftStickRight = Keys.Right;
playerInputOne.VirtualGamePadMapping.LeftStickBackward = Keys.Down;


Jan 7, 2012 at 5:54 AM

I figured it out.  Intellisense wasn't kicking in on my Xbox project (makes sense since the Xbox doesn't have a Keyboard) so I wrapped it with #if WINDOWS ... #endif and we're good now.  When you rework your Ace on Steroids project you might want to toss that in :)

Thanks for you help Philippe!

Jan 7, 2012 at 9:48 PM

The new tutorials based on Ace on Steroids will be targeting Windows, Xbox & WP7 so I'll make sure to place these conditional instructions whenever they make sense. Thanks for pointing that out.


Jan 8, 2012 at 12:06 AM

No problem Philippe.  Good luck on your project, it's looking freakin great!