OIS::Win32Keyboard Class Reference

#include <Win32KeyBoard.h>

Inheritance diagram for OIS::Win32Keyboard:
[legend]
Collaboration diagram for OIS::Win32Keyboard:
[legend]

List of all members.

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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


Detailed Description

Definition at line 31 of file Win32KeyBoard.h.


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)

Definition at line 32 of file Win32KeyBoard.cpp.

References coopSetting, deadKey, KeyBuffer, OIS::Keyboard::listener, OIS::Object::mBuffered, OIS::Object::mCreator, mDirectInput, mKeyboard, OIS::Object::mType, and OISKeyboard.

Win32Keyboard::~Win32Keyboard (  )  [virtual]

Definition at line 83 of file Win32KeyBoard.cpp.

References mKeyboard.

OIS::Win32Keyboard::Win32Keyboard (  )  [inline, protected]

Definition at line 68 of file Win32KeyBoard.h.


Member Function Documentation

bool Win32Keyboard::isKeyDown ( KeyCode  key  )  [virtual]

Remarks:
Returns true if key is donwn
Parameters:
key A KeyCode to check

Implements OIS::Keyboard.

Definition at line 246 of file Win32KeyBoard.cpp.

References KeyBuffer.

Referenced by _read().

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.

Definition at line 252 of file Win32KeyBoard.cpp.

References mGetString, and mKeyboard.

void Win32Keyboard::copyKeyStates ( char  keys[256]  )  [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.

Definition at line 275 of file Win32KeyBoard.cpp.

References KeyBuffer.

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

Remarks:
Sets buffered mode

Implements OIS::Object.

Definition at line 282 of file Win32KeyBoard.cpp.

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

void Win32Keyboard::capture (  )  [virtual]

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

Implements OIS::Object.

Definition at line 94 of file Win32KeyBoard.cpp.

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

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.

Definition at line 63 of file Win32KeyBoard.h.

void Win32Keyboard::_initialize (  )  [virtual]

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

Implements OIS::Object.

Definition at line 48 of file Win32KeyBoard.cpp.

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

Referenced by setBuffered().

void Win32Keyboard::_readBuffered (  )  [protected]

Definition at line 103 of file Win32KeyBoard.cpp.

References _translateText(), OIS::Keyboard::Alt, OIS::Keyboard::Ctrl, 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(), OIS::Keyboard::listener, mKeyboard, OIS::Keyboard::mModifiers, OIS_EXCEPT, and OIS::Keyboard::Shift.

Referenced by capture().

void Win32Keyboard::_read (  )  [protected]

Definition at line 166 of file Win32KeyBoard.cpp.

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 capture().

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

Internal method for translating KeyCodes to Text.

Definition at line 188 of file Win32KeyBoard.cpp.

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

Referenced by _readBuffered().


Member Data Documentation

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

Definition at line 73 of file Win32KeyBoard.h.

Referenced by _initialize(), and Win32Keyboard().

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

Definition at line 74 of file Win32KeyBoard.h.

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

DWORD OIS::Win32Keyboard::coopSetting [protected]

Definition at line 75 of file Win32KeyBoard.h.

Referenced by _initialize(), and Win32Keyboard().

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

Definition at line 77 of file Win32KeyBoard.h.

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

WCHAR OIS::Win32Keyboard::deadKey [protected]

Stored dead key from last translation.

Definition at line 83 of file Win32KeyBoard.h.

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

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

used for getAsString

Definition at line 86 of file Win32KeyBoard.h.

Referenced by getAsString().


The documentation for this class was generated from the following files:
Generated on Sat Dec 1 20:13:56 2007 for OIS by  doxygen 1.5.4