diff options
| author | Erik Kundiman <erik@megapahit.org> | 2023-12-15 18:28:43 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2023-12-15 18:28:43 +0800 |
| commit | 91b49c8bfa061f3d3b8601d5398b1889a9e31850 (patch) | |
| tree | 98adc151491a2bee51a70cf7dd37de21d4f32bb3 /indra/llwindow/llkeyboard.cpp | |
| parent | 0cce0b8149e049161ab17f1c608ded2d6cc12b0e (diff) | |
| parent | a80e3fe4191aee87c566937953d52fa6498b7f32 (diff) | |
Merge tag '7.1.1-release'
source for viewer 7.1.1.7039128750
Diffstat (limited to 'indra/llwindow/llkeyboard.cpp')
| -rw-r--r-- | indra/llwindow/llkeyboard.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index ac8c97d34e..7d28486287 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) |
