Orxonox: OIS::Win32Keyboard Class Reference

# OIS::Win32Keyboard Class Reference

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

Inheritance diagram for OIS::Win32Keyboard:

List of all members.

## Public Member Functions

virtual void | _initialize ()
virtual void | capture ()
virtual void | copyKeyStates (char keys[256]) const
virtual const std::string & | getAsString (KeyCode kc)
virtual bool | isKeyDown (KeyCode key) const
virtual Interface * | queryInterface (Interface::IType type)
virtual void | setBuffered (bool buffered)
| Win32Keyboard (InputManager *creator, IDirectInput8 *pDI, bool buffered, DWORD coopSettings)
virtual | ~Win32Keyboard ()

## Protected Member Functions

void | _read ()
void | _readBuffered ()
int | _translateText (KeyCode kc)
| Internal method for translating KeyCodes to Text.

## Protected Attributes

DWORD | coopSetting
WCHAR | deadKey
| Stored dead key from last translation.
unsigned char | KeyBuffer [256]
IDirectInput8 * | mDirectInput
std::string | mGetString
| used for getAsString
IDirectInputDevice8 * | mKeyboard

## Constructor & Destructor Documentation

Win32Keyboard::Win32Keyboard | ( | InputManager * | creator,
|  | IDirectInput8 * | pDI,
|  | bool | buffered,
|  | DWORD | coopSettings |
| ) |  |  |

Remarks:
  Constructor

Parameters:

  | pDI | Valid DirectInput8 Interface
  | buffered | True for buffered input mode
  | coopSettings | A combination of DI Flags (see DX Help for info on input device settings)

References coopSetting, deadKey, KeyBuffer, OIS::Object::mCreator, mDirectInput, and mKeyboard.

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

References OIS::Object::mCreator, and mKeyboard.

## Member Function Documentation

void Win32Keyboard::_initialize | ( |  | ) | `[virtual]`

Remarks:
  Internal... Do not call this directly.

Implements OIS::Object.

References coopSetting, deadKey, OIS::E_General, KEYBOARD_DX_BUFFERSIZE, OIS::Object::mBuffered, OIS::Object::mCreator, mDirectInput, mKeyboard, OIS::Keyboard::mModifiers, and OIS_EXCEPT.

Referenced by setBuffered().

void Win32Keyboard::_read | ( |  | ) | `[protected]`

References OIS::Keyboard::Alt, OIS::Keyboard::Ctrl, isKeyDown(), OIS::KC_LCONTROL, OIS::KC_LMENU, OIS::KC_LSHIFT, OIS::KC_RCONTROL, OIS::KC_RMENU, OIS::KC_RSHIFT, KeyBuffer, mKeyboard, OIS::Keyboard::mModifiers, and OIS::Keyboard::Shift.

Referenced by _readBuffered(), and capture().

void Win32Keyboard::_readBuffered | ( |  | ) | `[protected]`

References _read(), _translateText(), OIS::Keyboard::Alt, OIS::Keyboard::Ctrl, OIS::E_General, OIS::KC_LCONTROL, OIS::KC_LMENU, OIS::KC_LSHIFT, OIS::KC_RCONTROL, OIS::KC_RMENU, OIS::KC_RSHIFT, KEYBOARD_DX_BUFFERSIZE, KeyBuffer, OIS::KeyListener::keyPressed(), OIS::KeyListener::keyReleased(), mKeyboard, OIS::Keyboard::mListener, OIS::Keyboard::mModifiers, OIS_EXCEPT, and OIS::Keyboard::Shift.

Referenced by capture().

int Win32Keyboard::_translateText | ( | KeyCode | kc | ) | `[protected]`

Internal method for translating KeyCodes to Text.

References deadKey, OIS::Keyboard::mTextMode, and OIS::Keyboard::Off.

Referenced by _readBuffered().

void Win32Keyboard::capture | ( |  | ) | `[virtual]`

Remarks:
  Used for updating call once per frame before checking state or to update events

Implements OIS::Object.

References _read(), _readBuffered(), and OIS::Object::mBuffered.

void Win32Keyboard::copyKeyStates | ( | char | keys[256] | ) | const`[virtual]`

Remarks:
  Copies the state of the keys into the sent buffer (in the form of 1 is down and 0 is up)

Implements OIS::Keyboard.

References KeyBuffer.

const std::string & Win32Keyboard::getAsString | ( | KeyCode | kc | ) | `[virtual]`

Remarks:
  Translates KeyCode to string representation. For example, KC_ENTER will be "Enter" - Locale specific of course.

Parameters:

  | kc | KeyCode to convert

Returns:
  The string as determined from the current locale

Implements OIS::Keyboard.

References mGetString, and mKeyboard.

bool Win32Keyboard::isKeyDown | ( | KeyCode | key | ) | const`[virtual]`

Remarks:
  Returns true if key is donwn

Parameters:

  | key | A KeyCode to check

Implements OIS::Keyboard.

References KeyBuffer.

Referenced by _read().

virtual Interface* OIS::Win32Keyboard::queryInterface | ( | Interface::IType | type | ) | `[inline, virtual]`

Remarks:
  If available, get an interface to write to some devices. Examples include, turning on and off LEDs, ForceFeedback, etc

Parameters:

  | type | The type of interface you are looking for

Implements OIS::Object.

void Win32Keyboard::setBuffered | ( | bool | buffered | ) | `[virtual]`

Remarks:
  Sets buffered mode

Implements OIS::Object.

References _initialize(), OIS::Object::mBuffered, and mKeyboard.

## Member Data Documentation

DWORD OIS::Win32Keyboard::coopSetting`[protected]`

Referenced by _initialize(), and Win32Keyboard().

WCHAR OIS::Win32Keyboard::deadKey`[protected]`

Stored dead key from last translation.

Referenced by _initialize(), _translateText(), and Win32Keyboard().

unsigned char OIS::Win32Keyboard::KeyBuffer[256]`[protected]`

Referenced by _read(), _readBuffered(), copyKeyStates(), isKeyDown(), and Win32Keyboard().

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

Referenced by _initialize(), and Win32Keyboard().

std::string OIS::Win32Keyboard::mGetString`[protected]`

used for getAsString

Referenced by getAsString().

IDirectInputDevice8* OIS::Win32Keyboard::mKeyboard`[protected]`

Referenced by _initialize(), _read(), _readBuffered(), getAsString(), setBuffered(), Win32Keyboard(), and ~Win32Keyboard().

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

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