From b184099a5fb57d7d679235b5ab5af2f70516014e Mon Sep 17 00:00:00 2001 From: Arrehn Date: Sat, 18 Dec 2010 20:40:20 -0500 Subject: [PATCH] Backported LL configuration to allow chat bar to take focus on type due to popular demand. --- FIRESTORM-FEATURETABLE.txt | 1 + indra/newview/app_settings/settings.xml | 11 +++++ indra/newview/llviewerwindow.cpp | 14 ++++++ .../default/xui/en/panel_preferences_chat.xml | 47 +++++++++++++++++-- 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/FIRESTORM-FEATURETABLE.txt b/FIRESTORM-FEATURETABLE.txt index 6e53c77b07..f500c88fc1 100644 --- a/FIRESTORM-FEATURETABLE.txt +++ b/FIRESTORM-FEATURETABLE.txt @@ -24,3 +24,4 @@ NonBusyAutoresponse LGPL V1_Clienttags LGPL AlwaysShowFriendPerms LGPL GlobalFriendVisToggle LGPL +IM_IconifiedToolbar LGPL diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0bd938a21a..6960973ba6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1626,6 +1626,17 @@ Boolean Value 1 + + LetterKeysFocusChatBar + + Comment + When printable characters keys (possibly with Shift held) are pressed, the chatbar takes focus + Persist + 1 + Type + S32 + Value + 0 ChatBubbleOpacity diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9ec1f569ab..c0f5b6b88b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2265,6 +2265,20 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) return TRUE; } + // If "Pressing letter keys starts local chat" option is selected, we are not in mouselook, + // no view has keyboard focus, this is a printable character key (and no modifier key is + // pressed except shift), then give focus to nearby chat (STORM-560) + if ( gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() && + !keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) ) + { + LLLineEditor* chat_editor = LLBottomTray::instanceExists() ? LLBottomTray::getInstance()->getNearbyChatBar()->getChatBox() : NULL; + if (chat_editor) + { + // passing NULL here, character will be added later when it is handled by character handler. + LLBottomTray::getInstance()->getNearbyChatBar()->startChat(NULL); + return TRUE; + } + } // give menus a chance to handle unmodified accelerator keys if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask)) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index ee7bb4dcbf..c4bcaf9b9f 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -117,6 +117,47 @@ name="bubble_text_chat" width="150" /> + + Pressing letter keys: + + + + + + + + Show IMs in: - - + (requires restart) - + +