gedi::Joystick Class Reference

#include <Joystick.h>

Inherited by gedi::JoystickState.

Inheritance diagram for gedi::Joystick:

[legend]
List of all members.

Public Member Functions

 Joystick (void)
 ~Joystick (void)
gedi::Error32 Init (HWND hWindow, gedi::Int32 iMin, gedi::Int32 iMax, gedi::Int32 iDeadZone)
gedi::Error32 Update (void)
gedi::Bool32 IsButtonDown (gedi::UInt32 iButton)
gedi::Bool32 IsButtonUp (gedi::UInt32 iButton)
gedi::UInt32 GetXAxis (void)
gedi::UInt32 GetYAxis (void)

Protected Attributes

LPDIRECTINPUTDEVICE8 m_lpkDIDevice
DIJOYSTATE2 m_kDeviceData

Detailed Description

Mirus joystick class.

Handles connection to, calibration, and control of joystick. Two main methods support discrete (ie, button) and analog (ie, continuous) inputs. Note that this class does not specify the button numbers. You should consult the game controller manufacturer or invoke the poswdm program.


Constructor & Destructor Documentation

gedi::Joystick::Joystick ( void   ) 

Constructor.

gedi::Joystick::~Joystick ( void   ) 

Destructor.


Member Function Documentation

gedi::Error32 gedi::Joystick::Init ( HWND  hWindow,
gedi::Int32  iMin,
gedi::Int32  iMax,
gedi::Int32  iDeadZone 
)

Initializes and calibrates the joystick.

Parameters:
hWindow Handle to window controlling the device.
iMin Minimum X-Y control output.
iMax Maximum X-Y control output.
iDeadZone Amount of movement in stick which returns nothing.
Returns:
gedi::True if initialization successful, gedi::False otherwise.

gedi::Error32 gedi::Joystick::Update ( void   ) 

Update the device state.

gedi::Bool32 gedi::Joystick::IsButtonDown ( gedi::UInt32  iButton  ) 

Check if button pressed.

Parameters:
iButton Button number.
Returns:
gedi::True if button pressed, gedi::False otherwise.

gedi::Bool32 gedi::Joystick::IsButtonUp ( gedi::UInt32  iButton  ) 

Check if button released

Parameters:
iButton Button number.
Returns:
gedi::True if button released, gedi::False otherwise.

gedi::UInt32 gedi::Joystick::GetXAxis ( void   ) 

Get the X axis value in [iMin,iMax] range.

Returns:
X axis value.

gedi::UInt32 gedi::Joystick::GetYAxis ( void   ) 

Get the Y axis value in [iMin,iMax] range.

Returns:
Y axis value.


Member Data Documentation

LPDIRECTINPUTDEVICE8 gedi::Joystick::m_lpkDIDevice [protected]

DirectInput object

DIJOYSTATE2 gedi::Joystick::m_kDeviceData [protected]

DirectInput object


The documentation for this class was generated from the following files: