This project is read-only.
Project Description
The DirectX Input for XNA allows usage of DirectX compatibles Joysticks in XNA game development for windows.

How to use?
Create a GameComponent, add DXJoy.dll in references and add DXJoystickSupport in using declarations. After do this, put the follow code in respective methods listed above:
  • Initialize
    • DXJoy.Load(this.Game);
  • Update
    • DXJoy.Poll();
  • Dispose
    • DXJoy.Unload();

Insert the follow code in your game constructor(where YourGameComponent is the GameComponent created below):
  • this.Components.Add(new YourGameComponent(this));

DXJoy works like Microsoft.Xna.Framework.Input.GamePad. Here has a sample of use:

if (DXJoy.GetState(PlayerIndex.One).Buttons.NegativeXAxis.Equals(ButtonState.Pressed))
   //do something
if (DXJoy.GetState(PlayerIndex.One).Buttons.PointOfViewW.Equals(ButtonState.Pressed))
   //do something
if (DXJoy.GetState(PlayerIndex.One).Buttons.Button1.Equals(ButtonState.Pressed))
   //do something

Credits to Everaldo Coelho
Website: e
license: LGPL

Developed by Applied Information Technology Laboratory - LTIA, from Sao Paulo State University - UNESP

Last edited Mar 23, 2009 at 7:43 PM by fabio_mastelari, version 6