LLKeyboard Class Reference

#include <llkeyboard.h>

Inheritance diagram for LLKeyboard:

Inheritance graph
[legend]
Collaboration diagram for LLKeyboard:

Collaboration graph
[legend]
List of all members.

Public Types

typedef enum LLKeyboard::e_numpad_distinct ENumpadDistinct
 ND_NEVER
 ND_NUMLOCK_OFF
 ND_NUMLOCK_ON
enum  e_numpad_distinct { ND_NEVER, ND_NUMLOCK_OFF, ND_NUMLOCK_ON }

Public Member Functions

 LLKeyboard ()
virtual ~LLKeyboard ()
void resetKeys ()
F32 getCurKeyElapsedTime ()
F32 getCurKeyElapsedFrameCount ()
BOOL getKeyDown (const KEY key)
BOOL getKeyRepeated (const KEY key)
BOOL translateKey (const U16 os_key, KEY *translated_key)
U16 inverseTranslateKey (const KEY translated_key)
BOOL handleTranslatedKeyUp (KEY translated_key, U32 translated_mask)
BOOL handleTranslatedKeyDown (KEY translated_key, U32 translated_mask)
virtual BOOL handleKeyUp (const U16 key, MASK mask)=0
virtual BOOL handleKeyDown (const U16 key, MASK mask)=0
virtual void resetMaskKeys ()=0
virtual void scanKeyboard ()=0
virtual MASK currentMask (BOOL for_mouse_event)=0
virtual KEY currentKey ()
EKeyboardInsertMode getInsertMode ()
void toggleInsertMode ()
e_numpad_distinct getNumpadDistinct ()
void setNumpadDistinct (e_numpad_distinct val)
void setCallbacks (LLWindowCallbacks *cbs)
F32 getKeyElapsedTime (KEY key)
S32 getKeyElapsedFrameCount (KEY key)

Static Public Member Functions

static BOOL maskFromString (const LLString &str, MASK *mask)
static BOOL keyFromString (const LLString &str, KEY *key)
static LLString stringFromKey (KEY key)

Protected Member Functions

void addKeyName (KEY key, const LLString &name)

Protected Attributes

std::map< U16, KEYmTranslateKeyMap
std::map< KEY, U16mInvTranslateKeyMap
LLWindowCallbacksmCallbacks
LLTimer mKeyLevelTimer [KEY_COUNT]
S32 mKeyLevelFrameCount [KEY_COUNT]
BOOL mKeyLevel [KEY_COUNT]
BOOL mKeyRepeated [KEY_COUNT]
BOOL mKeyUp [KEY_COUNT]
BOOL mKeyDown [KEY_COUNT]
KEY mCurTranslatedKey
KEY mCurScanKey
e_numpad_distinct mNumpadDistinct
EKeyboardInsertMode mInsertMode

Static Protected Attributes

static std::map< KEY, LLStringsKeysToNames
static std::map< LLString,
KEY
sNamesToKeys

Detailed Description

Definition at line 67 of file llkeyboard.h.


Member Typedef Documentation

typedef enum LLKeyboard::e_numpad_distinct LLKeyboard::ENumpadDistinct


Member Enumeration Documentation

enum LLKeyboard::e_numpad_distinct

Enumerator:
ND_NEVER 
ND_NUMLOCK_OFF 
ND_NUMLOCK_ON 

Definition at line 70 of file llkeyboard.h.


Constructor & Destructor Documentation

LLKeyboard::LLKeyboard (  ) 

Definition at line 53 of file llkeyboard.cpp.

References addKeyName(), FALSE, i, KEY_ADD, KEY_ALT, KEY_BACKSPACE, KEY_BUTTON0, KEY_BUTTON1, KEY_BUTTON10, KEY_BUTTON11, KEY_BUTTON12, KEY_BUTTON13, KEY_BUTTON14, KEY_BUTTON15, KEY_BUTTON2, KEY_BUTTON3, KEY_BUTTON4, KEY_BUTTON5, KEY_BUTTON6, KEY_BUTTON7, KEY_BUTTON8, KEY_BUTTON9, KEY_CAPSLOCK, KEY_CONTROL, KEY_COUNT, KEY_DELETE, KEY_DIVIDE, KEY_DOWN, KEY_END, KEY_EQUALS, KEY_ESCAPE, KEY_F1, KEY_F10, KEY_F11, KEY_F12, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_HOME, KEY_HYPHEN, KEY_INSERT, KEY_LEFT, KEY_MULTIPLY, KEY_NONE, KEY_PAD_CENTER, KEY_PAD_DEL, KEY_PAD_DOWN, KEY_PAD_END, KEY_PAD_HOME, KEY_PAD_INS, KEY_PAD_LEFT, KEY_PAD_PGDN, KEY_PAD_PGUP, KEY_PAD_RETURN, KEY_PAD_RIGHT, KEY_PAD_UP, KEY_PAGE_DOWN, KEY_PAGE_UP, KEY_RETURN, KEY_RIGHT, KEY_SHIFT, KEY_SUBTRACT, KEY_TAB, KEY_UP, LL_KIM_INSERT, mCurTranslatedKey, mInsertMode, mKeyDown, mKeyLevel, mKeyLevelFrameCount, mKeyRepeated, mKeyUp, and S32.

LLKeyboard::~LLKeyboard (  )  [virtual]

Definition at line 140 of file llkeyboard.cpp.


Member Function Documentation

void LLKeyboard::addKeyName ( KEY  key,
const LLString name 
) [protected]

Definition at line 145 of file llkeyboard.cpp.

References sKeysToNames, sNamesToKeys, and LLStringBase< char >::toUpper().

Referenced by LLKeyboard().

virtual KEY LLKeyboard::currentKey (  )  [inline, virtual]

Definition at line 105 of file llkeyboard.h.

References mCurTranslatedKey.

Referenced by LLViewerWindow::handlePerFrameHover(), LLChatBar::onInputEditorKeystroke(), and LLComboBox::onTextEntry().

virtual MASK LLKeyboard::currentMask ( BOOL  for_mouse_event  )  [pure virtual]

Implemented in LLKeyboardMacOSX, LLKeyboardSDL, and LLKeyboardWin32.

Referenced by LLToolBrushLand::brush(), LLToolSelectRect::draw(), LLToolMgr::getCurrentTool(), LLViewerWindow::handlePerFrameHover(), LLViewerWindow::hitObjectOrLandGlobalImmediate(), LLViewerWindow::hitUIElementImmediate(), LLSelectMgr::renderSilhouettes(), LLViewerKeyboard::scanKey(), and send_agent_update().

F32 LLKeyboard::getCurKeyElapsedFrameCount (  )  [inline]

Definition at line 85 of file llkeyboard.h.

References getKeyDown(), getKeyElapsedFrameCount(), and mCurScanKey.

Referenced by agent_jump(), agent_push_backward(), agent_push_forward(), agent_slide_left(), and agent_slide_right().

F32 LLKeyboard::getCurKeyElapsedTime (  )  [inline]

Definition at line 84 of file llkeyboard.h.

References getKeyDown(), getKeyElapsedTime(), and mCurScanKey.

Referenced by agent_jump(), agent_push_backward(), agent_push_forward(), agent_slide_left(), agent_slide_right(), agent_turn_left(), agent_turn_right(), and get_orbit_rate().

EKeyboardInsertMode LLKeyboard::getInsertMode (  )  [inline]

Definition at line 107 of file llkeyboard.h.

References mInsertMode.

Referenced by LLTextEditor::addChar(), LLLineEditor::addChar(), LLLineEditor::draw(), and LLTextEditor::drawCursor().

BOOL LLKeyboard::getKeyDown ( const KEY  key  )  [inline]

Definition at line 86 of file llkeyboard.h.

References mKeyLevel.

Referenced by LLMenuBarGL::checkMenuTrigger(), LLButton::draw(), getCurKeyElapsedFrameCount(), getCurKeyElapsedTime(), LLVoiceClient::keyDown(), LLVoiceClient::keyUp(), and LLPanelLogin::onPassKey().

S32 LLKeyboard::getKeyElapsedFrameCount ( KEY  key  ) 

Definition at line 289 of file llkeyboard.cpp.

References mKeyLevelFrameCount.

Referenced by LLMenuBarGL::checkMenuTrigger(), and getCurKeyElapsedFrameCount().

F32 LLKeyboard::getKeyElapsedTime ( KEY  key  ) 

Definition at line 283 of file llkeyboard.cpp.

References LLTimer::getElapsedTimeF32(), and mKeyLevelTimer.

Referenced by LLMenuBarGL::checkMenuTrigger(), and getCurKeyElapsedTime().

BOOL LLKeyboard::getKeyRepeated ( const KEY  key  )  [inline]

Definition at line 87 of file llkeyboard.h.

References mKeyRepeated.

Referenced by LLMenuBarGL::handleAcceleratorKey(), LLMenuItemCallGL::handleAcceleratorKey(), LLMenuItemGL::handleAcceleratorKey(), LLMenuBarGL::handleKeyHere(), LLButton::handleKeyHere(), LLViewerWindow::handleUnicodeChar(), LLButton::handleUnicodeCharHere(), LLVoiceClient::keyDown(), and LLViewerKeyboard::scanKey().

e_numpad_distinct LLKeyboard::getNumpadDistinct (  )  [inline]

Definition at line 114 of file llkeyboard.h.

References mNumpadDistinct.

virtual BOOL LLKeyboard::handleKeyDown ( const U16  key,
MASK  mask 
) [pure virtual]

Implemented in LLKeyboardMacOSX, LLKeyboardSDL, and LLKeyboardWin32.

virtual BOOL LLKeyboard::handleKeyUp ( const U16  key,
MASK  mask 
) [pure virtual]

Implemented in LLKeyboardMacOSX, LLKeyboardSDL, and LLKeyboardWin32.

BOOL LLKeyboard::handleTranslatedKeyDown ( KEY  translated_key,
U32  translated_mask 
)

Definition at line 219 of file llkeyboard.cpp.

References FALSE, LLWindowCallbacks::handleTranslatedKeyDown(), mCallbacks, mCurTranslatedKey, mKeyDown, mKeyLevel, mKeyLevelFrameCount, mKeyLevelTimer, mKeyRepeated, LLTimer::reset(), and TRUE.

Referenced by LLViewerJoystick::scanJoystick().

BOOL LLKeyboard::handleTranslatedKeyUp ( KEY  translated_key,
U32  translated_mask 
)

Definition at line 247 of file llkeyboard.cpp.

References FALSE, LLWindowCallbacks::handleTranslatedKeyUp(), lldebugst, llendl, mCallbacks, mKeyLevel, mKeyUp, and TRUE.

Referenced by LLViewerJoystick::scanJoystick().

U16 LLKeyboard::inverseTranslateKey ( const KEY  translated_key  ) 

Definition at line 204 of file llkeyboard.cpp.

References mInvTranslateKeyMap.

BOOL LLKeyboard::keyFromString ( const LLString str,
KEY key 
) [static]

Definition at line 295 of file llkeyboard.cpp.

References FALSE, get_if_there(), llendl, llwarns, sNamesToKeys, LLStringBase< char >::toUpper(), and TRUE.

Referenced by LLPreviewGesture::createGesture(), LLViewerKeyboard::loadBindings(), LLMenuGL::parseChildXML(), and LLVoiceClient::setPTTKey().

BOOL LLKeyboard::maskFromString ( const LLString str,
MASK mask 
) [static]

Definition at line 348 of file llkeyboard.cpp.

References FALSE, MASK_ALT, MASK_CONTROL, MASK_NONE, MASK_SHIFT, and TRUE.

Referenced by LLViewerKeyboard::loadBindings().

void LLKeyboard::resetKeys (  ) 

Definition at line 155 of file llkeyboard.cpp.

References FALSE, i, KEY_COUNT, mKeyDown, mKeyLevel, mKeyRepeated, mKeyUp, and S32.

Referenced by LLViewerWindow::handleFocusLost(), idle_startup(), and LLChatBar::stopChat().

virtual void LLKeyboard::resetMaskKeys (  )  [pure virtual]

Implemented in LLKeyboardMacOSX, LLKeyboardSDL, and LLKeyboardWin32.

Referenced by LLViewerWindow::handleFocus(), and LLChatBar::stopChat().

virtual void LLKeyboard::scanKeyboard (  )  [pure virtual]

Implemented in LLKeyboardMacOSX, LLKeyboardSDL, and LLKeyboardWin32.

Referenced by main_loop(), and process_keystrokes_async().

void LLKeyboard::setCallbacks ( LLWindowCallbacks cbs  )  [inline]

Definition at line 117 of file llkeyboard.h.

References mCallbacks.

Referenced by LLWindow::setCallbacks().

void LLKeyboard::setNumpadDistinct ( e_numpad_distinct  val  )  [inline]

Definition at line 115 of file llkeyboard.h.

References mNumpadDistinct.

Referenced by LLNumpadControlListener::handleEvent().

LLString LLKeyboard::stringFromKey ( KEY  key  )  [static]

Definition at line 332 of file llkeyboard.cpp.

References get_if_there(), LLStringBase< char >::null, and sKeysToNames.

Referenced by LLPreviewGesture::addKeys(), LLMenuItemGL::appendAcceleratorString(), LLFloaterGesture::buildGestureList(), LLMenuItemGL::getXML(), LLPreviewGesture::loadUIFromGesture(), and LLPrefsVoiceLogic::setKey().

void LLKeyboard::toggleInsertMode (  ) 

Definition at line 269 of file llkeyboard.cpp.

References LL_KIM_INSERT, LL_KIM_OVERWRITE, and mInsertMode.

Referenced by LLTextEditor::handleSpecialKey(), and LLLineEditor::handleSpecialKey().

BOOL LLKeyboard::translateKey ( const U16  os_key,
KEY translated_key 
)

Definition at line 184 of file llkeyboard.cpp.

References FALSE, mTranslateKeyMap, and TRUE.


Member Data Documentation

LLWindowCallbacks* LLKeyboard::mCallbacks [protected]

Definition at line 127 of file llkeyboard.h.

Referenced by handleTranslatedKeyDown(), handleTranslatedKeyUp(), and setCallbacks().

KEY LLKeyboard::mCurScanKey [protected]

Definition at line 136 of file llkeyboard.h.

Referenced by getCurKeyElapsedFrameCount(), and getCurKeyElapsedTime().

KEY LLKeyboard::mCurTranslatedKey [protected]

Definition at line 135 of file llkeyboard.h.

Referenced by currentKey(), handleTranslatedKeyDown(), and LLKeyboard().

EKeyboardInsertMode LLKeyboard::mInsertMode [protected]

Definition at line 140 of file llkeyboard.h.

Referenced by getInsertMode(), LLKeyboard(), and toggleInsertMode().

std::map<KEY, U16> LLKeyboard::mInvTranslateKeyMap [protected]

Definition at line 126 of file llkeyboard.h.

Referenced by inverseTranslateKey().

BOOL LLKeyboard::mKeyDown[KEY_COUNT] [protected]

Definition at line 134 of file llkeyboard.h.

Referenced by handleTranslatedKeyDown(), LLKeyboard(), and resetKeys().

BOOL LLKeyboard::mKeyLevel[KEY_COUNT] [protected]

Definition at line 131 of file llkeyboard.h.

Referenced by getKeyDown(), handleTranslatedKeyDown(), handleTranslatedKeyUp(), LLKeyboard(), and resetKeys().

S32 LLKeyboard::mKeyLevelFrameCount[KEY_COUNT] [protected]

Definition at line 130 of file llkeyboard.h.

Referenced by getKeyElapsedFrameCount(), handleTranslatedKeyDown(), and LLKeyboard().

LLTimer LLKeyboard::mKeyLevelTimer[KEY_COUNT] [protected]

Definition at line 129 of file llkeyboard.h.

Referenced by getKeyElapsedTime(), and handleTranslatedKeyDown().

BOOL LLKeyboard::mKeyRepeated[KEY_COUNT] [protected]

Definition at line 132 of file llkeyboard.h.

Referenced by getKeyRepeated(), handleTranslatedKeyDown(), LLKeyboard(), and resetKeys().

BOOL LLKeyboard::mKeyUp[KEY_COUNT] [protected]

Definition at line 133 of file llkeyboard.h.

Referenced by handleTranslatedKeyUp(), LLKeyboard(), and resetKeys().

e_numpad_distinct LLKeyboard::mNumpadDistinct [protected]

Definition at line 138 of file llkeyboard.h.

Referenced by getNumpadDistinct(), and setNumpadDistinct().

std::map<U16, KEY> LLKeyboard::mTranslateKeyMap [protected]

Definition at line 125 of file llkeyboard.h.

Referenced by translateKey().

std::map< KEY, LLString > LLKeyboard::sKeysToNames [static, protected]

Definition at line 142 of file llkeyboard.h.

Referenced by addKeyName(), and stringFromKey().

std::map< LLString, KEY > LLKeyboard::sNamesToKeys [static, protected]

Definition at line 143 of file llkeyboard.h.

Referenced by addKeyName(), and keyFromString().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:26 2010 for Second Life Viewer by  doxygen 1.4.7