Keyboard
Introduction
Detecting Keyboard Activity
using FlatRedBall.Input;
using Microsoft.Xna.Framework.Input; // for the Keys enumvoid CustomActivity(bool firstTimeCalled)
{
if(InputManager.Keyboard.KeyPushed(Keys.A))
{
// The A key was just pushed - down this frame, up last frame.
}
if(InputManager.Keyboard.KeyDown(Keys.B))
{
// The B key is down this frame.
}
if(InputManager.Keyboard.KeyReleased(Keys.C))
{
// The C key was just released - down last frame, up this frame.
}
if(InputManager.Keyboard.KeyTyped(Keys.D))
{
// The D key was just typed - either Pushed this frame or typed
// again because the key was held down.
}
}Controlling Objects With the Keyboard
Last updated
Was this helpful?