Export (0) Print
Expand All

Input

The XNA Framework Microsoft.Xna.Framework.Input namespace provides classes and methods for retrieving user input for keyboard, mouse, and Xbox 360 controller devices.

In This Section

Input Overview
This article is an introduction to handling user input in XNA Game Studio.
How To: Detect Whether a Controller Button Is Pressed
This example demonstrates how to detect whether a user has pressed a digital button on a connected Xbox 360 Controller.
How To: Detect Whether a Controller Button Has Been Pressed This Frame
This example demonstrates how to detect whether a user has just pressed a digital button on a connected Xbox 360 Controller. This example ignores held buttons, only activating when a button has been pressed in the current frame.
How To: Detect Whether a Controller Is Disconnected
This example demonstrates how to detect whether an Xbox 360 Controller connected to the system at game start has become disconnected.
How To: Get the Current Mouse Position (Windows)
This example demonstrates how to get the current horizontal and vertical position of the mouse cursor relative to the upper-left corner a game window.
How To: Detect Whether a Key Is Pressed
This example demonstrates how to detect whether a user has pressed or released a key on the keyboard.

Community Additions

ADD
Show:
© 2014 Microsoft