Input Tutorials

Below is a collection of tutorials about getting input from the player in many different ways, including a keyboard, a mouse, and an Xbox 360 controller. These tutorials are designed in such a way that you should be able to go through them at any time, even if you haven't completed the 2D or 3D tutorials, or even before you've started on any of them. A few of the tutorials will use stuff in other tutorials to display what the user is currently doing, but in these cases, there is a link back to the tutorial that discusses this, although is shouldn't be too hard to just ingore that stuff if you don't want to go back to another tutorial.

Also, you don't need to go through these tutorials in order. If you are looking for a tutorial about Xbox controller input, jump down to those tutorials.


1 - Keyboard Input

This tutorial will cover one of the simplest and most powerful way of getting input from a user: the keyboard.
Keyboard Input


2 - Mouse Input

Often a mouse is the simplest way for a user to interact with a game. This tutorial covers the basics of getting input from a mouse in an XNA game.
Mouse Input


3 - Picking

This is a slightly more advanced tutorial, and it would be useful to have gone through most of the 3D tutorials before going through this one. Picking is where a user is able to use a mouse to select objects in a 3D scene. This tutorial covers a simple but fairly accurate method for performing picking in XNA.


4 - Xbox Controller Input

Since XNA games work on the Xbox, many of you will be interested in learning how you can get input from a player who is using an Xbox controller. This tutorial covers getting input from an Xbox controller. Also, for your information, Xbox controllers also work on a PC, so even if you aren't planning on making a game that works on the Xbox 360, you might still be interested in getting input from a controller anyway.
Xbox Controller Input


5 - Xbox Controller Vibration

Now that you have an understanding of how to get input from an xbox controller, you might be interested in knowing how to make the xbox controller vibrate. It's actually pretty simple to do.
Xbox Controller Vibration