summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-11-10 19:06:03 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-11-10 19:06:03 +0200
commit56105df3999cee7a86c4338d105358875967225a (patch)
treeba2094243e573f222884c079a01229eef123ef82 /indra/llwindow
parente8958a1c8921ec58653b1245be5dd767cfead6dd (diff)
SL-6109 Better key and table localization support and fix for key-replacing
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llkeyboard.cpp11
-rw-r--r--indra/llwindow/llkeyboard.h2
2 files changed, 8 insertions, 5 deletions
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp
index 8e75325859..5404ac50e5 100644
--- a/indra/llwindow/llkeyboard.cpp
+++ b/indra/llwindow/llkeyboard.cpp
@@ -327,7 +327,7 @@ BOOL LLKeyboard::keyFromString(const std::string& str, KEY *key)
// static
-std::string LLKeyboard::stringFromKey(KEY key)
+std::string LLKeyboard::stringFromKey(KEY key, bool translate)
{
std::string res = get_if_there(sKeysToNames, key, std::string());
if (res.empty())
@@ -338,10 +338,13 @@ std::string LLKeyboard::stringFromKey(KEY key)
res = std::string(buffer);
}
- LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator;
- if (trans != NULL)
+ if (translate)
{
- res = trans(res.c_str());
+ LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator;
+ if (trans != NULL)
+ {
+ res = trans(res.c_str());
+ }
}
return res;
diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h
index f6404164e7..36bd8bcbed 100644
--- a/indra/llwindow/llkeyboard.h
+++ b/indra/llwindow/llkeyboard.h
@@ -94,7 +94,7 @@ public:
static BOOL maskFromString(const std::string& str, MASK *mask); // False on failure
static BOOL keyFromString(const std::string& str, KEY *key); // False on failure
- static std::string stringFromKey(KEY key);
+ static std::string stringFromKey(KEY key, bool translate = true);
static std::string stringFromAccelerator( MASK accel_mask ); // separated for convinience, returns with "+": "Shift+" or "Shift+Alt+"...
static std::string stringFromAccelerator( MASK accel_mask, KEY key );