Overview Chapter

class CDXInput

Constructors and Destructors
CDXInputDefault constructor.
~CDXInputDefault destructor.
Operations
Create Try to accquire all devices.
FlushKeyboardData Wipes out the internal key data.
GetJoystickDeltas Retrieves the joystick deltas and stores the x and y values in the passed parameters.
GetJoystickFreePos Retrieves the free joystick position and stores the x and y values in the passed parameters.
GetJoystickPos Retrieves the joystick position and stores the x and y values in the passed parameters.
GetJoystickSensitivity Retrieves the current Joystick sensitivity factor.
GetJoystickType
GetKeyDesc Fills the str with the Description of the CeckKey.
GetKeyRaw Gets raw information about a key.
GetKeyState Retrieves the keystate of a given key.
GetLastKey
GetLastKeyChar Will convert LastKey to Scancode like in dos.
GetMouseDeltas Retrieves the mouse deltas and stores the x and y values in the passed parameters.
GetMouseFreePos Retrieves the free mouse position and stores the x and y values in the passed parameters.
GetMousePos Retrieves the mouse position and stores the x and y values in the passed parameters.
GetMouseSensitivity Retrieves the current mouse sensitivity factor.
GetNumberOfJoystickButtons Returns the number of buttons the joystick has.
GetShiftedKeyState This tells you whether or not the given key is in a shifted state.
HasJoystick Janni.
HasMouse
IsGamePad Returns TRUE, if the control is a gamepad this is useful if you want to know if the joystick is analog or digital so you can check for the correct axes values.
RunJoystickControlPanel Runs the DirectInput control panel associated with the joystick.
RunMouseControlPanel Runs the DirectInput control panel associated with the mouse.
SetActiveDevices Controls which devices you have accquired.
SetJoystickAbs Sets the axis mode of the joystick.
SetJoystickFreePos Sets the joystick position.
SetJoystickLimits HRESULT SetMouseCooperative(DWORD inFlags);
SetJoystickPos Sets the joystick position.
SetJoystickSensitivity Sets the Joystick sensitivity factor.
SetMouseAbs Sets the axis mode of the mouse.
SetMouseFreePos Sets the mouse position.
SetMouseLimits This restricts the mouse to a defined area.
SetMousePos Sets the mouse position.
SetMouseSensitivity Sets the mouse sensitivity factor.
Update Updates all devices.
UpdateLastKey Updates the m_LastKey variable, and fills it with the LastKey pressed.
AcquireJoystick Obtains access to the joystick.
AcquireKeyboard Obtains access to the keyboard.
AcquireMouse Obtains access to the mouse.
CheckKeyEvents Checks for keyboard events.
InitDIKToCDXKEY Since we can't guarantee that the constants for these DIKs won't change, initialize the remap table here instead of statically doing it.
InitShiftedKeys Initializes the shifted key states.
UnacquireJoystick Releases access to the joystick.
UnacquireKeyboard Releases access to the keyboard.
UnacquireMouse Releases access to the mouse.
   
                      
Data Members
public
DWORD m_DIKToCDXKEY [ NUMDIKEYS ];
DWORD m_JoystickType;
BYTE m_LastKey;
BOOL m_bJoystick;
BOOL m_bKeyboard;
BOOL m_bMouse;
LONG m_joystickDeltaX, m_joystickDeltaY;
LONG m_joystickFreeX, m_joystickFreeY;
LONG m_joystickMaxX;
LONG m_joystickMaxY;
LONG m_joystickMinX;
LONG m_joystickMinY;
float m_joystickSensitivity;
LONG m_joystickX, m_joystickY;
DWORD m_keyDragStartPositions [ CDXKEY_NUMKEYS ] [ 2 ];
DWORD m_keyPressTimes [ CDXKEY_NUMKEYS ];
BYTE m_keyRaw [ NUMDIKEYS ];
BYTE m_keyStates [ CDXKEY_NUMKEYS ];
LPDIRECTINPUT m_lpDI;Private:
LPDIRECTINPUTDEVICE2 m_lpDIDJoystick;
LPDIRECTINPUTDEVICE m_lpDIDKeyboard;
LPDIRECTINPUTDEVICE m_lpDIDMouse;
LONG m_mouseDeltaX, m_mouseDeltaY;
LONG m_mouseFreeX, m_mouseFreeY;
LONG m_mouseMaxX;
LONG m_mouseMaxY;
LONG m_mouseMinX;
LONG m_mouseMinY;
float m_mouseSensitivity;
LONG m_mouseX, m_mouseY;
BYTE m_oldkeyRaw [ NUMDIKEYS ];
BYTE m_shiftedKeyStates [ CDXKEY_NUMKEYS ];