summaryrefslogtreecommitdiff
path: root/indra/llwindow/llkeyboard.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2024-01-24 14:37:33 -0800
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2024-01-24 14:37:33 -0800
commit373b06398c274eee476e4aa9c35b9c6327f9d45f (patch)
tree4a324b36ab896d9507374e71e15f9ec064b41add /indra/llwindow/llkeyboard.cpp
parentbd9c0a2e658e183bb8a321cdce546f10b6d76afe (diff)
parentc22aefafb3d05be37965361913c02568fa10adf6 (diff)
Merge remote-tracking branch 'origin/release/materials_featurette' into DRTVWR-583
Diffstat (limited to 'indra/llwindow/llkeyboard.cpp')
-rw-r--r--indra/llwindow/llkeyboard.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp
index e65cc7563e..34720ff64e 100644
--- a/indra/llwindow/llkeyboard.cpp
+++ b/indra/llwindow/llkeyboard.cpp
@@ -367,6 +367,45 @@ std::string LLKeyboard::stringFromKey(KEY key, bool translate)
}
//static
+std::string LLKeyboard::stringFromMouse(EMouseClickType click, bool translate)
+{
+ std::string res;
+ switch (click)
+ {
+ case CLICK_LEFT:
+ res = "LMB";
+ break;
+ case CLICK_MIDDLE:
+ res = "MMB";
+ break;
+ case CLICK_RIGHT:
+ res = "RMB";
+ break;
+ case CLICK_BUTTON4:
+ res = "MB4";
+ break;
+ case CLICK_BUTTON5:
+ res = "MB5";
+ break;
+ case CLICK_DOUBLELEFT:
+ res = "Double LMB";
+ break;
+ default:
+ break;
+ }
+
+ if (translate && !res.empty())
+ {
+ LLKeyStringTranslatorFunc* trans = gKeyboard->mStringTranslator;
+ if (trans != NULL)
+ {
+ res = trans(res.c_str());
+ }
+ }
+ return res;
+}
+
+//static
std::string LLKeyboard::stringFromAccelerator(MASK accel_mask)
{
std::string res;
@@ -433,6 +472,18 @@ std::string LLKeyboard::stringFromAccelerator( MASK accel_mask, KEY key )
return res;
}
+//static
+std::string LLKeyboard::stringFromAccelerator(MASK accel_mask, EMouseClickType click)
+{
+ std::string res;
+ if (CLICK_NONE == click)
+ {
+ return res;
+ }
+ res.append(stringFromAccelerator(accel_mask));
+ res.append(stringFromMouse(click));
+ return res;
+}
//static
BOOL LLKeyboard::maskFromString(const std::string& str, MASK *mask)