summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerkeyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerkeyboard.cpp')
-rw-r--r--indra/newview/llviewerkeyboard.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index a8f88ec036..8a5a5e99c9 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -477,6 +477,24 @@ void start_chat( EKeystate s )
gChatBar->startChat(NULL);
}
+void start_gesture( EKeystate s )
+{
+ if (KEYSTATE_UP == s &&
+ !gChatBar->inputEditorHasFocus())
+ {
+ if (gChatBar->getCurrentChat().empty())
+ {
+ // No existing chat in chat editor, insert '/'
+ gChatBar->startChat("/");
+ }
+ else
+ {
+ // Don't overwrite existing text in chat editor
+ gChatBar->startChat(NULL);
+ }
+ }
+}
+
void bind_keyboard_functions()
{
gViewerKeyboard.bindNamedFunction("jump", agent_jump);
@@ -518,6 +536,7 @@ void bind_keyboard_functions()
gViewerKeyboard.bindNamedFunction("edit_avatar_move_backward", edit_avatar_move_backward);
gViewerKeyboard.bindNamedFunction("stop_moving", stop_moving);
gViewerKeyboard.bindNamedFunction("start_chat", start_chat);
+ gViewerKeyboard.bindNamedFunction("start_gesture", start_gesture);
}
LLViewerKeyboard::LLViewerKeyboard()