Tutorial 1: Init DirectInput

In this tutorial we start programming a new class for all input devices. In the first tutorial we just init DirectInput. It is nearly the same procedure like with Direct3D. At the beginning we have to create the main DirectInput object. In the next tutorials we add the keyboard, the mouse and the joystick support to the class. We take the source code of the Direct3D tutorial two, so that we have a whole application. Later we take tutorial four, so that we can use the input to manipulate the scene.

Online Tutorial

Tutorial 2: Using The Keyboard

In this tutorial we do a bit more than before. We have the beginning of the input class, which inits DirectInput for now. Now we add keyboard support to the class. We have to create an input device for the main system keyboard and to set the behaviour. Then we need two more functions. One to update the status of the keyboard and one to ask for a pressed key. We use the code of Direct3D tutorial four. With the keys we can then modify the pyramide. Please read and understand the code of the Direct3D tutorial before you start with this one. I will not explain the parts concerning that, but only the new input class specific parts.

Online Tutorial

Tutorial 3: Using The Mouse

This tutorial covers the usage of the mouse with the help of DirectInput. I will only explain the important parts of the code especially on how to init the mouse and get data from it. There are some more functions, which you can use to load a new cursor or get the mouse position, etc. Something to people, who use the Microsoft IntelliPoint software. You have to set all mouse buttons to their default values. DirectInput wont be able to use them if you defined other values.

Online Tutorial