aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow/llkeyboard.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llwindow/llkeyboard.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-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.cpp27
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 @@
43LLKeyboard *gKeyboard = NULL; 43LLKeyboard *gKeyboard = NULL;
44 44
45//static 45//static
46std::map<KEY,LLString> LLKeyboard::sKeysToNames; 46std::map<KEY,std::string> LLKeyboard::sKeysToNames;
47std::map<LLString,KEY> LLKeyboard::sNamesToKeys; 47std::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
146void LLKeyboard::addKeyName(KEY key, const LLString& name) 147void 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
296BOOL LLKeyboard::keyFromString(const LLString& str, KEY *key) 297BOOL 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
333LLString LLKeyboard::stringFromKey(KEY key) 334std::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
349BOOL LLKeyboard::maskFromString(const LLString& str, MASK *mask) 350BOOL 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;