How To: Use Input

public override bool Enabled
{
set
{
base.Enabled = value;
if (value)
{
IInputService inputService = this.GetService(typeof(IInputService)) as IInputService;
if (inputService.PlayerOne.HasValue)
{
this.gamePad = inputService.GetInputState(inputService.PlayerOne.Value);
}
else
{
// In this case, the input state will be dead because it is never updated.
this.gamePad = new InputState(PlayerIndex.One);
}
this.keyboard = inputService.Keyboard;
}
}
}

Last edited Sep 20, 2010 at 7:59 PM by BadCorporateLogo, version 1

Comments

No comments yet.