OIS::LinuxKeyboard Class Reference

#include <LinuxKeyboard.h>

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

List of all members.

Public Member Functions

 LinuxKeyboard (InputManager *creator, bool buffered, bool grab, bool useXRepeat)
virtual ~LinuxKeyboard ()
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)
virtual void _initialize ()

Protected Types

typedef std::map< KeySym, KeyCodeXtoOIS_KeyMap
 1:1 Conversion Map between X Key Events and OIS KeyCodes

Protected Member Functions

bool _injectKeyDown (KeySym key, int text)
bool _injectKeyUp (KeySym key)

Protected Attributes

XtoOIS_KeyMap keyConversion
char KeyBuffer [256]
 Depressed Key List.
Window window
 X11 Stuff.
Display * display
bool grabKeyboard
bool keyFocusLost
bool xAutoRepeat
bool oldXAutoRepeat
std::string mGetString


Detailed Description

Linux implementation of Keyboard object - uses x11

Definition at line 33 of file LinuxKeyboard.h.


Member Typedef Documentation

typedef std::map<KeySym, KeyCode> OIS::LinuxKeyboard::XtoOIS_KeyMap [protected]

1:1 Conversion Map between X Key Events and OIS KeyCodes

Definition at line 65 of file LinuxKeyboard.h.


Constructor & Destructor Documentation

LinuxKeyboard::LinuxKeyboard ( InputManager creator,
bool  buffered,
bool  grab,
bool  useXRepeat 
)

Definition at line 34 of file LinuxKeyboard.cpp.

References display, grabKeyboard, OIS::KC_0, OIS::KC_1, OIS::KC_2, OIS::KC_3, OIS::KC_4, OIS::KC_5, OIS::KC_6, OIS::KC_7, OIS::KC_8, OIS::KC_9, OIS::KC_A, OIS::KC_ADD, OIS::KC_APOSTROPHE, OIS::KC_APPS, OIS::KC_B, OIS::KC_BACK, OIS::KC_BACKSLASH, OIS::KC_C, OIS::KC_CAPITAL, OIS::KC_COLON, OIS::KC_COMMA, OIS::KC_D, OIS::KC_DECIMAL, OIS::KC_DELETE, OIS::KC_DIVIDE, OIS::KC_DOWN, OIS::KC_E, OIS::KC_END, OIS::KC_EQUALS, OIS::KC_ESCAPE, OIS::KC_F, OIS::KC_F1, OIS::KC_F10, OIS::KC_F11, OIS::KC_F12, OIS::KC_F13, OIS::KC_F14, OIS::KC_F15, OIS::KC_F2, OIS::KC_F3, OIS::KC_F4, OIS::KC_F5, OIS::KC_F6, OIS::KC_F7, OIS::KC_F8, OIS::KC_F9, OIS::KC_G, OIS::KC_GRAVE, OIS::KC_H, OIS::KC_HOME, OIS::KC_I, OIS::KC_INSERT, OIS::KC_J, OIS::KC_K, OIS::KC_L, OIS::KC_LBRACKET, OIS::KC_LCONTROL, OIS::KC_LEFT, OIS::KC_LMENU, OIS::KC_LSHIFT, OIS::KC_LWIN, OIS::KC_M, OIS::KC_MINUS, OIS::KC_MULTIPLY, OIS::KC_N, OIS::KC_NUMLOCK, OIS::KC_NUMPAD0, OIS::KC_NUMPAD1, OIS::KC_NUMPAD2, OIS::KC_NUMPAD3, OIS::KC_NUMPAD4, OIS::KC_NUMPAD5, OIS::KC_NUMPAD6, OIS::KC_NUMPAD7, OIS::KC_NUMPAD8, OIS::KC_NUMPAD9, OIS::KC_NUMPADENTER, OIS::KC_NUMPADEQUALS, OIS::KC_O, OIS::KC_P, OIS::KC_PAUSE, OIS::KC_PERIOD, OIS::KC_PGDOWN, OIS::KC_PGUP, OIS::KC_Q, OIS::KC_R, OIS::KC_RBRACKET, OIS::KC_RCONTROL, OIS::KC_RETURN, OIS::KC_RIGHT, OIS::KC_RMENU, OIS::KC_RSHIFT, OIS::KC_RWIN, OIS::KC_S, OIS::KC_SCROLL, OIS::KC_SEMICOLON, OIS::KC_SLASH, OIS::KC_SPACE, OIS::KC_SUBTRACT, OIS::KC_SYSRQ, OIS::KC_T, OIS::KC_TAB, OIS::KC_U, OIS::KC_UP, OIS::KC_V, OIS::KC_W, OIS::KC_X, OIS::KC_Y, OIS::KC_Z, keyConversion, keyFocusLost, OIS::Keyboard::listener, OIS::Object::mBuffered, OIS::Object::mCreator, OIS::Object::mType, OISKeyboard, oldXAutoRepeat, window, and xAutoRepeat.

LinuxKeyboard::~LinuxKeyboard (  )  [virtual]

Definition at line 230 of file LinuxKeyboard.cpp.

References display, grabKeyboard, and oldXAutoRepeat.


Member Function Documentation

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

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

Implements OIS::Keyboard.

Definition at line 245 of file LinuxKeyboard.cpp.

References KeyBuffer.

const std::string & LinuxKeyboard::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 367 of file LinuxKeyboard.cpp.

void LinuxKeyboard::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 390 of file LinuxKeyboard.cpp.

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

Remarks:
Sets buffered mode

Implements OIS::Object.

Definition at line 321 of file LinuxKeyboard.cpp.

void LinuxKeyboard::capture (  )  [virtual]

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

Implements OIS::Object.

Definition at line 251 of file LinuxKeyboard.cpp.

References OIS::LinuxInputManager::_getGrabState(), _injectKeyDown(), _injectKeyUp(), OIS::LinuxInputManager::_setGrabState(), display, grabKeyboard, keyFocusLost, OIS::Object::mCreator, OIS::Keyboard::mTextMode, OIS::Keyboard::Off, and window.

virtual Interface* OIS::LinuxKeyboard::queryInterface ( Interface::IType   )  [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 55 of file LinuxKeyboard.h.

void LinuxKeyboard::_initialize (  )  [virtual]

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

Implements OIS::Object.

Definition at line 191 of file LinuxKeyboard.cpp.

References display, grabKeyboard, KeyBuffer, keyFocusLost, OIS::Object::mCreator, OIS::Keyboard::mModifiers, OIS_EXCEPT, oldXAutoRepeat, window, and xAutoRepeat.

bool LinuxKeyboard::_injectKeyDown ( KeySym  key,
int  text 
) [protected]

Definition at line 327 of file LinuxKeyboard.cpp.

References OIS::Object::mBuffered.

Referenced by capture().

bool LinuxKeyboard::_injectKeyUp ( KeySym  key  )  [protected]

Definition at line 347 of file LinuxKeyboard.cpp.

Referenced by capture().


Member Data Documentation

XtoOIS_KeyMap OIS::LinuxKeyboard::keyConversion [protected]

Definition at line 66 of file LinuxKeyboard.h.

Referenced by LinuxKeyboard().

char OIS::LinuxKeyboard::KeyBuffer[256] [protected]

Depressed Key List.

Definition at line 69 of file LinuxKeyboard.h.

Referenced by _initialize(), and isKeyDown().

Window OIS::LinuxKeyboard::window [protected]

X11 Stuff.

Definition at line 72 of file LinuxKeyboard.h.

Referenced by _initialize(), capture(), and LinuxKeyboard().

Display* OIS::LinuxKeyboard::display [protected]

Definition at line 73 of file LinuxKeyboard.h.

Referenced by _initialize(), capture(), LinuxKeyboard(), and ~LinuxKeyboard().

bool OIS::LinuxKeyboard::grabKeyboard [protected]

Definition at line 74 of file LinuxKeyboard.h.

Referenced by _initialize(), capture(), LinuxKeyboard(), and ~LinuxKeyboard().

bool OIS::LinuxKeyboard::keyFocusLost [protected]

Definition at line 75 of file LinuxKeyboard.h.

Referenced by _initialize(), capture(), and LinuxKeyboard().

bool OIS::LinuxKeyboard::xAutoRepeat [protected]

Definition at line 77 of file LinuxKeyboard.h.

Referenced by _initialize(), and LinuxKeyboard().

bool OIS::LinuxKeyboard::oldXAutoRepeat [protected]

Definition at line 78 of file LinuxKeyboard.h.

Referenced by _initialize(), LinuxKeyboard(), and ~LinuxKeyboard().

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

Definition at line 80 of file LinuxKeyboard.h.


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