summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorAndrew Productengine <adyukov@productengine.com>2010-11-18 23:09:05 +0200
committerAndrew Productengine <adyukov@productengine.com>2010-11-18 23:09:05 +0200
commitf0a0831954475a2f49fe7473046f0ba657fb2405 (patch)
tree238d00655cb7041e0012fbc72f049b22eb2bf0ed /indra/newview/llviewerwindow.cpp
parentd76e0dd87f64258ade944323eb5cb6063bca7444 (diff)
STORM-560 FIXED Implemented preference that allows users to select default behavior when pressing letter keys.
- Added check to LLViewerWindow::handleKey() that gives focus to nearby chat if "Pressing letter keys starts local chat" option is selected, key is not special (and no modifier key is held except Shift), camera is not in mouselook and no view currently has keyboard focus. - The choice of what should happen when letter keys are pressed is saved in new setting added in this fix- "LetterKeysFocusChatBar".
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 743def4a0c..a7790243ed 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2266,6 +2266,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))