Orxonox: OIS::Win32InputManager Class Reference

# OIS::Win32InputManager Class Reference

`#include <src/ois/win32/Win32InputManager.h>`

Inheritance diagram for OIS::Win32InputManager:

List of all members.

## Public Member Functions

void | _initialize (ParamList &paramList)
void | _returnJoyStick (const JoyStickInfo &joystick)
| Internal method, return unused joystick to queue.
void | _setKeyboardUsed (bool used)
| Internal method, used for flaggin keyboard as available/unavailable for creation.
void | _setMouseUsed (bool used)
| Internal method, used for flaggin mouse as available/unavailable for creation.
Object * | createObject (InputManager *creator, Type iType, bool bufferMode, const std::string &vendor="")
void | destroyObject (Object *obj)
DeviceList | freeDeviceList ()
int | freeDevices (Type iType)
HWND | getWindowHandle ()
| Returns HWND needed by DirectInput Device Object.
int | totalDevices (Type iType)
bool | vendorExist (Type iType, const std::string &vendor)
| Win32InputManager ()
virtual | ~Win32InputManager ()

## Protected Member Functions

void | _enumerateDevices ()
| internal class method for finding attached devices
void | _parseConfigSettings (ParamList &paramList)
| internal class method for dealing with param list

## Static Protected Member Functions

static BOOL CALLBACK | _DIEnumKbdCallback (LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
| Used during device enumeration.

## Protected Attributes

HWND | hWnd
| The window handle we are using.
DWORD | joySettings
| Used for joystick device settings.
char | joySticks
| Number of total joysticks (inuse or not).
DWORD | kbSettings
| Used for keyboard device settings.
bool | keyboardUsed
| Used to know if we used up keyboard.
IDirectInput8 * | mDirectInput
| Direct Input Interface.
DWORD | mouseSettings
| Used for mouse device settings.
bool | mouseUsed
| Used to know if we used up mouse.
JoyStickInfoList | unusedJoyStickList
| Keep a list of all joysticks enumerated, but not in use.

## Detailed Description

Win32InputManager specialization - Using DirectInput8

## Constructor & Destructor Documentation

Win32InputManager::Win32InputManager | ( |  | ) |

References hWnd, joySettings, joySticks, kbSettings, keyboardUsed, mDirectInput, OIS::InputManager::mFactories, mouseSettings, and mouseUsed.

Win32InputManager::~Win32InputManager | ( |  | ) | `[virtual]`

References mDirectInput.

## Member Function Documentation

BOOL CALLBACK Win32InputManager::_DIEnumKbdCallback | ( | LPCDIDEVICEINSTANCE | lpddi,
|  | LPVOID | pvRef |
| ) |  |  | `[static, protected]`

Used during device enumeration.

References OIS::JoyStickInfo::deviceID, OIS::JoyStickInfo::devId, joySticks, unusedJoyStickList, and OIS::JoyStickInfo::vendor.

Referenced by _enumerateDevices().

void Win32InputManager::_enumerateDevices | ( |  | ) | `[protected]`

internal class method for finding attached devices

References _DIEnumKbdCallback(), and mDirectInput.

Referenced by _initialize().

void Win32InputManager::_initialize | ( | ParamList & | paramList | ) | `[virtual]`

Remarks:
  Called from createInputSystem, gives derived input class a chance to setup after it is created

Implements OIS::InputManager.

References _enumerateDevices(), _parseConfigSettings(), DIRECTINPUT_VERSION, OIS::E_General, OIS::E_InvalidParam, hWnd, mDirectInput, and OIS_EXCEPT.

void Win32InputManager::_parseConfigSettings | ( | ParamList & | paramList | ) | `[protected]`

internal class method for dealing with param list

References joySettings, kbSettings, and mouseSettings.

Referenced by _initialize().

void Win32InputManager::_returnJoyStick | ( | const JoyStickInfo & | joystick | ) |

Internal method, return unused joystick to queue.

References unusedJoyStickList.

void OIS::Win32InputManager::_setKeyboardUsed | ( | bool | used | ) | `[inline]`

Internal method, used for flaggin keyboard as available/unavailable for creation.

References keyboardUsed.

void OIS::Win32InputManager::_setMouseUsed | ( | bool | used | ) | `[inline]`

Internal method, used for flaggin mouse as available/unavailable for creation.

References mouseUsed.

Object * Win32InputManager::createObject | ( | InputManager * | creator,
|  | Type | iType,
|  | bool | bufferMode,
|  | const std::string & | vendor = `""` |
| ) |  |  | `[virtual]`

Remarks:
  Creates the object

Parameters:

  | iType | Type to create
  | bufferMode | True to setup for buffered events
  | vendor | Create a device with the vendor name, "" means vendor name is unimportant

Implements OIS::FactoryCreator.

References OIS::E_InputDeviceNonExistant, joySettings, kbSettings, keyboardUsed, mDirectInput, mouseSettings, mouseUsed, OIS_EXCEPT, OIS::OISJoyStick, OIS::OISKeyboard, OIS::OISMouse, and unusedJoyStickList.

void Win32InputManager::destroyObject | ( | Object * | obj | ) | `[virtual]`

Remarks:
  Destroys object

Parameters:

  | obj | Object to destroy

Implements OIS::FactoryCreator.

DeviceList Win32InputManager::freeDeviceList | ( |  | ) | `[virtual]`

Implements OIS::FactoryCreator.

References keyboardUsed, OIS::InputManager::mInputSystemName, mouseUsed, OIS::OISJoyStick, OIS::OISKeyboard, OIS::OISMouse, and unusedJoyStickList.

int Win32InputManager::freeDevices | ( | Type | iType | ) | `[virtual]`

Remarks:
  Number of free devices of requested type

Parameters:

  | iType | Type of devices to check

Implements OIS::FactoryCreator.

References keyboardUsed, mouseUsed, OIS::OISJoyStick, OIS::OISKeyboard, OIS::OISMouse, and unusedJoyStickList.

HWND OIS::Win32InputManager::getWindowHandle | ( |  | ) | `[inline]`

Returns HWND needed by DirectInput Device Object.

References hWnd.

int Win32InputManager::totalDevices | ( | Type | iType | ) | `[virtual]`

Remarks:
  Number of total devices of requested type

Parameters:

  | iType | Type of devices to check

Implements OIS::FactoryCreator.

References joySticks, OIS::OISJoyStick, OIS::OISKeyboard, and OIS::OISMouse.

bool Win32InputManager::vendorExist | ( | Type | iType,
|  | const std::string & | vendor |
| ) |  |  | `[virtual]`

Remarks:
  Does a Type exist with the given vendor name

Parameters:

  | iType | Type to check
  | vendor | Vendor name to test

Implements OIS::FactoryCreator.

References OIS::InputManager::mInputSystemName, OIS::OISJoyStick, OIS::OISKeyboard, OIS::OISMouse, and unusedJoyStickList.

## Member Data Documentation

HWND OIS::Win32InputManager::hWnd`[protected]`

The window handle we are using.

Referenced by _initialize(), getWindowHandle(), and Win32InputManager().

DWORD OIS::Win32InputManager::joySettings`[protected]`

Used for joystick device settings.

Referenced by _parseConfigSettings(), createObject(), and Win32InputManager().

char OIS::Win32InputManager::joySticks`[protected]`

Number of total joysticks (inuse or not).

Referenced by _DIEnumKbdCallback(), totalDevices(), and Win32InputManager().

DWORD OIS::Win32InputManager::kbSettings`[protected]`

Used for keyboard device settings.

Referenced by _parseConfigSettings(), createObject(), and Win32InputManager().

bool OIS::Win32InputManager::keyboardUsed`[protected]`

Used to know if we used up keyboard.

Referenced by _setKeyboardUsed(), createObject(), freeDeviceList(), freeDevices(), and Win32InputManager().

IDirectInput8* OIS::Win32InputManager::mDirectInput`[protected]`

Direct Input Interface.

Referenced by _enumerateDevices(), _initialize(), createObject(), Win32InputManager(), and ~Win32InputManager().

DWORD OIS::Win32InputManager::mouseSettings`[protected]`

Used for mouse device settings.

Referenced by _parseConfigSettings(), createObject(), and Win32InputManager().

bool OIS::Win32InputManager::mouseUsed`[protected]`

Used to know if we used up mouse.

Referenced by _setMouseUsed(), createObject(), freeDeviceList(), freeDevices(), and Win32InputManager().

JoyStickInfoList OIS::Win32InputManager::unusedJoyStickList`[protected]`

Keep a list of all joysticks enumerated, but not in use.

Referenced by _DIEnumKbdCallback(), _returnJoyStick(), createObject(), freeDeviceList(), freeDevices(), and vendorExist().

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

- src/ois/win32/Win32InputManager.h
- src/ois/win32/Win32InputManager.cpp