Skip to content
Snippets Groups Projects
Commit 9e6677ff authored by maxim@mnikolenko's avatar maxim@mnikolenko
Browse files

CHUI-692 FIXED Arrow keys will move avatar while IM container, nearby chat or...

CHUI-692 FIXED Arrow keys will move avatar while IM container, nearby chat or IM session floater is in focus.
parent 824457f9
Branches
Tags
No related merge requests found
...@@ -2503,22 +2503,14 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) ...@@ -2503,22 +2503,14 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
return TRUE; return TRUE;
} }
LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); LLFloater* focused_floaterp = gFloaterView->getFocusedFloater();
std::string focusedFloaterName = (focused_floaterp ? focused_floaterp->getInstanceName() : "");
// Traverses up the hierarchy
if( keyboard_focus ) if( keyboard_focus )
{ {
if (nearby_chat) if ((focusedFloaterName == "nearby_chat") || (focusedFloaterName == "im_container") || (focusedFloaterName == "impanel"))
{
LLChatEntry* chat_editor = nearby_chat->getChatBox();
// arrow keys move avatar while chatting hack
if (chat_editor && chat_editor->hasFocus())
{ {
// If text field is empty, there's no point in trying to move if (gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
// cursor with arrow keys, so allow movement
if (chat_editor->getText().empty()
|| gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
{ {
// let Control-Up and Control-Down through for chat line history, // let Control-Up and Control-Down through for chat line history,
if (!(key == KEY_UP && mask == MASK_CONTROL) if (!(key == KEY_UP && mask == MASK_CONTROL)
...@@ -2542,7 +2534,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) ...@@ -2542,7 +2534,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
} }
} }
} }
}
if (keyboard_focus->handleKey(key, mask, FALSE)) if (keyboard_focus->handleKey(key, mask, FALSE))
{ {
...@@ -2575,6 +2566,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) ...@@ -2575,6 +2566,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
!keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) ) !keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) )
{ {
// Initialize nearby chat if it's missing // Initialize nearby chat if it's missing
LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
if (!nearby_chat) if (!nearby_chat)
{ {
LLSD name("im_container"); LLSD name("im_container");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment