#include <Joystick.h>
Inherited by gedi::JoystickState.
Inheritance diagram for gedi::Joystick:
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 |
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.
gedi::Joystick::Joystick | ( | void | ) |
Constructor.
gedi::Joystick::~Joystick | ( | void | ) |
Destructor.
gedi::Error32 gedi::Joystick::Init | ( | HWND | hWindow, | |
gedi::Int32 | iMin, | |||
gedi::Int32 | iMax, | |||
gedi::Int32 | iDeadZone | |||
) |
Initializes and calibrates the joystick.
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. |
gedi::Error32 gedi::Joystick::Update | ( | void | ) |
Update the device state.
gedi::Bool32 gedi::Joystick::IsButtonDown | ( | gedi::UInt32 | iButton | ) |
Check if button pressed.
iButton | Button number. |
gedi::Bool32 gedi::Joystick::IsButtonUp | ( | gedi::UInt32 | iButton | ) |
Check if button released
iButton | Button number. |
gedi::UInt32 gedi::Joystick::GetXAxis | ( | void | ) |
Get the X axis value in [iMin,iMax] range.
gedi::UInt32 gedi::Joystick::GetYAxis | ( | void | ) |
Get the Y axis value in [iMin,iMax] range.
LPDIRECTINPUTDEVICE8 gedi::Joystick::m_lpkDIDevice [protected] |
DirectInput object
DIJOYSTATE2 gedi::Joystick::m_kDeviceData [protected] |
DirectInput object