Unverified Commit 33d57a4b authored by Miezhiko's avatar Miezhiko
Browse files

nearly chat: shift+enter for newline, ctrl+shift+enter for whisper


Signed-off-by: Miezhiko's avatarMiezhiko <Miezhiko@gmail.com>
parent efe0130c
......@@ -1255,7 +1255,6 @@ void LLTextEditor::addLineBreakChar(BOOL group_together)
setCursorPos(mCursorPos + pos);
}
BOOL LLTextEditor::handleSelectionKey(const KEY key, const MASK mask)
{
BOOL handled = FALSE;
......
......@@ -213,6 +213,7 @@ class LLTextEditor :
bool getShowContextMenu() const { return mShowContextMenu; }
void setPassDelete(BOOL b) { mPassDelete = b; }
void handleNewLine() { addLineBreakChar(FALSE); }
protected:
void showContextMenu(S32 x, S32 y);
......
......@@ -414,7 +414,13 @@ BOOL LLFloaterIMNearbyChat::handleKeyHere( KEY key, MASK mask )
{
BOOL handled = FALSE;
if( KEY_RETURN == key && mask == MASK_CONTROL)
if (KEY_RETURN == key && mask == (MASK_CONTROL|MASK_SHIFT))
{
// whisper
sendChat(CHAT_TYPE_WHISPER);
handled = TRUE;
}
else if( KEY_RETURN == key && mask == MASK_CONTROL)
{
// shout
sendChat(CHAT_TYPE_SHOUT);
......@@ -422,12 +428,19 @@ BOOL LLFloaterIMNearbyChat::handleKeyHere( KEY key, MASK mask )
}
else if (KEY_RETURN == key && mask == MASK_SHIFT)
{
// whisper
sendChat(CHAT_TYPE_WHISPER);
// newline
if (mInputEditor)
{
// but don't allow multiple new lines
LLWString raw_text = mInputEditor->getWText();
if (raw_text[raw_text.length() - 1] != '\n')
{
mInputEditor->handleNewLine();
}
}
handled = TRUE;
}
if((mask == MASK_ALT) && isTornOff())
{
LLFloaterIMContainer* floater_container = LLFloaterIMContainer::getInstance();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment