O'Reilly logo

3D Game Development with Microsoft Silverlight 3 Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—mapping a gamepad to the keyboard

Your project manager brings you a new USB gamepad, similar to the one used by Sony Playstation 3 game console. He wants to control the Invaders 2D game using the gamepad's right mini stick.

Tip

We cannot use DirectX to access DirectInput in Silverlight. We cannot access the gamepad driver either. Therefore, we have to use a feature provided by most gamepad drivers, the keyboard and mouse mode.

We have to configure the gamepad driver to map four gamepad keys to the keyboard's cursor movement keys:

Tip

You need a USB gamepad with 4 axis and 2 mini sticks in order to complete the following exercises.

  1. Connect the USB gamepad to the computer and install its driver if you have not already done so.
  2. Go to

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required