diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llwindow/llkeyboard.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llwindow/llkeyboard.cpp')
-rw-r--r-- | linden/indra/llwindow/llkeyboard.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/linden/indra/llwindow/llkeyboard.cpp b/linden/indra/llwindow/llkeyboard.cpp index c6502ed..cc6f73b 100644 --- a/linden/indra/llwindow/llkeyboard.cpp +++ b/linden/indra/llwindow/llkeyboard.cpp | |||
@@ -43,8 +43,8 @@ | |||
43 | LLKeyboard *gKeyboard = NULL; | 43 | LLKeyboard *gKeyboard = NULL; |
44 | 44 | ||
45 | //static | 45 | //static |
46 | std::map<KEY,LLString> LLKeyboard::sKeysToNames; | 46 | std::map<KEY,std::string> LLKeyboard::sKeysToNames; |
47 | std::map<LLString,KEY> LLKeyboard::sNamesToKeys; | 47 | std::map<std::string,KEY> LLKeyboard::sNamesToKeys; |
48 | 48 | ||
49 | // | 49 | // |
50 | // Class Implementation | 50 | // Class Implementation |
@@ -67,6 +67,7 @@ LLKeyboard::LLKeyboard() : mCallbacks(NULL), mNumpadDistinct(ND_NUMLOCK_OFF) | |||
67 | 67 | ||
68 | mInsertMode = LL_KIM_INSERT; | 68 | mInsertMode = LL_KIM_INSERT; |
69 | mCurTranslatedKey = KEY_NONE; | 69 | mCurTranslatedKey = KEY_NONE; |
70 | mCurScanKey = KEY_NONE; | ||
70 | 71 | ||
71 | addKeyName(' ', "Space" ); | 72 | addKeyName(' ', "Space" ); |
72 | addKeyName(KEY_RETURN, "Enter" ); | 73 | addKeyName(KEY_RETURN, "Enter" ); |
@@ -143,11 +144,11 @@ LLKeyboard::~LLKeyboard() | |||
143 | // nothing | 144 | // nothing |
144 | } | 145 | } |
145 | 146 | ||
146 | void LLKeyboard::addKeyName(KEY key, const LLString& name) | 147 | void LLKeyboard::addKeyName(KEY key, const std::string& name) |
147 | { | 148 | { |
148 | sKeysToNames[key] = name; | 149 | sKeysToNames[key] = name; |
149 | LLString nameuc = name; | 150 | std::string nameuc = name; |
150 | LLString::toUpper(nameuc); | 151 | LLStringUtil::toUpper(nameuc); |
151 | sNamesToKeys[nameuc] = key; | 152 | sNamesToKeys[nameuc] = key; |
152 | } | 153 | } |
153 | 154 | ||
@@ -293,9 +294,9 @@ S32 LLKeyboard::getKeyElapsedFrameCount(KEY key) | |||
293 | } | 294 | } |
294 | 295 | ||
295 | // static | 296 | // static |
296 | BOOL LLKeyboard::keyFromString(const LLString& str, KEY *key) | 297 | BOOL LLKeyboard::keyFromString(const std::string& str, KEY *key) |
297 | { | 298 | { |
298 | LLString instring(str); | 299 | std::string instring(str); |
299 | size_t length = instring.size(); | 300 | size_t length = instring.size(); |
300 | 301 | ||
301 | if (length < 1) | 302 | if (length < 1) |
@@ -317,7 +318,7 @@ BOOL LLKeyboard::keyFromString(const LLString& str, KEY *key) | |||
317 | } | 318 | } |
318 | } | 319 | } |
319 | 320 | ||
320 | LLString::toUpper(instring); | 321 | LLStringUtil::toUpper(instring); |
321 | KEY res = get_if_there(sNamesToKeys, instring, (KEY)0); | 322 | KEY res = get_if_there(sNamesToKeys, instring, (KEY)0); |
322 | if (res != 0) | 323 | if (res != 0) |
323 | { | 324 | { |
@@ -330,15 +331,15 @@ BOOL LLKeyboard::keyFromString(const LLString& str, KEY *key) | |||
330 | 331 | ||
331 | 332 | ||
332 | // static | 333 | // static |
333 | LLString LLKeyboard::stringFromKey(KEY key) | 334 | std::string LLKeyboard::stringFromKey(KEY key) |
334 | { | 335 | { |
335 | LLString res = get_if_there(sKeysToNames, key, LLString::null); | 336 | std::string res = get_if_there(sKeysToNames, key, std::string()); |
336 | if (res.empty()) | 337 | if (res.empty()) |
337 | { | 338 | { |
338 | char buffer[2]; /* Flawfinder: ignore */ | 339 | char buffer[2]; /* Flawfinder: ignore */ |
339 | buffer[0] = key; | 340 | buffer[0] = key; |
340 | buffer[1] = '\0'; | 341 | buffer[1] = '\0'; |
341 | res = LLString(buffer); | 342 | res = std::string(buffer); |
342 | } | 343 | } |
343 | return res; | 344 | return res; |
344 | } | 345 | } |
@@ -346,9 +347,9 @@ LLString LLKeyboard::stringFromKey(KEY key) | |||
346 | 347 | ||
347 | 348 | ||
348 | //static | 349 | //static |
349 | BOOL LLKeyboard::maskFromString(const LLString& str, MASK *mask) | 350 | BOOL LLKeyboard::maskFromString(const std::string& str, MASK *mask) |
350 | { | 351 | { |
351 | LLString instring(str); | 352 | std::string instring(str); |
352 | if (instring == "NONE") | 353 | if (instring == "NONE") |
353 | { | 354 | { |
354 | *mask = MASK_NONE; | 355 | *mask = MASK_NONE; |