Commit d861b94f authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Merge branch 'newline' into 'master'

Chat: shift+enter for newline, ctrl+shift+enter for whisper

See merge request !47
parents efe0130c 48c1d7f1
......@@ -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;
......@@ -1785,6 +1784,18 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask)
autoIndent();
}
}
else if (mask == MASK_SHIFT)
{
if( mCursorPos > 0 )
{
const LLWString& text = getWText();
if( '\n' != text[ mCursorPos - 1 ] )
{
addLineBreakChar();
handled = TRUE;
}
}
}
else
{
handled = FALSE;
......
......@@ -414,20 +414,19 @@ 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))
{
// shout
sendChat(CHAT_TYPE_SHOUT);
// whisper
sendChat(CHAT_TYPE_WHISPER);
handled = TRUE;
}
else if (KEY_RETURN == key && mask == MASK_SHIFT)
else if( KEY_RETURN == key && mask == MASK_CONTROL)
{
// whisper
sendChat(CHAT_TYPE_WHISPER);
// shout
sendChat(CHAT_TYPE_SHOUT);
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