summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp2
-rwxr-xr-xindra/newview/llmediactrl.cpp10
-rwxr-xr-xindra/newview/llmediactrl.h4
-rwxr-xr-xindra/newview/llviewermedia.cpp9
-rwxr-xr-xindra/newview/llviewermediafocus.cpp17
-rwxr-xr-xindra/newview/llviewermediafocus.h4
-rwxr-xr-xindra/newview/llviewerwindow.cpp34
7 files changed, 63 insertions, 17 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 6aaf45c35d..984c650128 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1605,7 +1605,7 @@ bool sort_alpha(const LLViewerInventoryCategory* cat1, const LLViewerInventoryCa
void dump_trace(std::string& message, S32 depth, LLError::ELevel log_level)
{
- llinfos << "validate_marketplacelistings : error = "<< log_level << ", depth = " << depth << ", message = " << message << llendl;
+ LL_INFOS() << "validate_marketplacelistings : error = "<< log_level << ", depth = " << depth << ", message = " << message << LL_ENDL;
}
// Make all relevant business logic checks on the marketplace listings starting with the folder as argument.
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index d999c6f52b..9b8e24a8e8 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -1171,3 +1171,13 @@ void LLMediaCtrl::updateContextMenuParent(LLView* pNewParent)
{
mContextMenu->updateParent(pNewParent);
}
+
+bool LLMediaCtrl::wantsKeyUpKeyDown() const
+{
+ return true;
+}
+
+bool LLMediaCtrl::wantsReturnKey() const
+{
+ return true;
+}
diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h
index cb3a864d63..291d87073e 100755
--- a/indra/newview/llmediactrl.h
+++ b/indra/newview/llmediactrl.h
@@ -172,6 +172,10 @@ public:
void updateContextMenuParent(LLView* pNewParent);
+ // The Browser windows want keyup and keydown events. Overridden from LLFocusableElement to return true.
+ virtual bool wantsKeyUpKeyDown() const;
+ virtual bool wantsReturnKey() const;
+
protected:
void convertInputCoords(S32& x, S32& y);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 49d6c1021e..8a16243ec1 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -286,11 +286,11 @@ public:
const LLIOPipe::buffer_ptr_t& buffer)
{
const std::string url = getURL();
- llinfos << "@@@ URL to set cookie on" << url << llendl;
+ LL_INFOS() << "@@@ URL to set cookie on" << url << LL_ENDL;
// We don't care about the content of the response, only the Set-Cookie header.
- llinfos << dumpResponse()
- << " [headers:" << getResponseHeaders() << "]" << llendl;
+ LL_INFOS() << dumpResponse()
+ << " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
// *TODO: What about bad status codes? Does this destroy previous cookies?
@@ -2759,8 +2759,7 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask)
if (!result)
{
-
- LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
+ LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN, key, mask, native_key_data);
}
}
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index 1265ca0a70..7b4df3d3da 100755
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -354,7 +354,12 @@ BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent)
BOOL LLViewerMediaFocus::handleKeyUp(KEY key, MASK mask, BOOL called_from_parent)
{
- return true;
+ LLViewerMediaImpl* media_impl = getFocusedMediaImpl();
+ if (media_impl)
+ {
+ media_impl->handleKeyUpHere(key, mask);
+ }
+ return true;
}
@@ -610,3 +615,13 @@ LLUUID LLViewerMediaFocus::getControlsMediaID()
return LLUUID::null;
}
+
+bool LLViewerMediaFocus::wantsKeyUpKeyDown() const
+{
+ return true;
+}
+
+bool LLViewerMediaFocus::wantsReturnKey() const
+{
+ return true;
+}
diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h
index 42c841df15..0b2a64868e 100755
--- a/indra/newview/llviewermediafocus.h
+++ b/indra/newview/llviewermediafocus.h
@@ -88,6 +88,10 @@ public:
// Return the ID of the media instance the controls are currently attached to (either focus or hover).
LLUUID getControlsMediaID();
+ // The MoaP object wants keyup and keydown events. Overridden to return true.
+ virtual bool wantsKeyUpKeyDown() const;
+ virtual bool wantsReturnKey() const;
+
protected:
/*virtual*/ void onFocusReceived();
/*virtual*/ void onFocusLost();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b6212e0958..6be63ef889 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1381,7 +1381,11 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
// it's all entered/processed.
if (key == KEY_RETURN && mask == MASK_NONE)
{
- return FALSE;
+ // RIDER: although, at times some of the controlls (in particular the CEF viewer
+ // would like to know about the KEYDOWN for an enter key... so ask and pass it along.
+ LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+ if (keyboard_focus && !keyboard_focus->wantsReturnKey())
+ return FALSE;
}
return gViewerKeyboard.handleKey(key, mask, repeated);
@@ -2543,22 +2547,27 @@ void LLViewerWindow::draw()
//#endif
}
-// Takes a single keydown event, usually when UI is visible
+// Takes a single keyup event, usually when UI is visible
BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
{
- if (gFocusMgr.getKeyboardFocus()
+ LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+
+ if (keyboard_focus
&& !(mask & (MASK_CONTROL | MASK_ALT))
&& !gFocusMgr.getKeystrokesOnly())
{
// We have keyboard focus, and it's not an accelerator
- if (key < 0x80)
+ if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown())
+ {
+ return keyboard_focus->handleKey(key, mask, FALSE);
+ }
+ else if (key < 0x80)
{
// Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first.
return (gFocusMgr.getKeyboardFocus() != NULL);
}
}
- LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
if (keyboard_focus)
{
if (keyboard_focus->handleKeyUp(key, mask, FALSE))
@@ -2584,15 +2593,21 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// hide tooltips on keypress
LLToolTipMgr::instance().blockToolTips();
- if (gFocusMgr.getKeyboardFocus()
+ LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+
+ if (keyboard_focus
&& !(mask & (MASK_CONTROL | MASK_ALT))
&& !gFocusMgr.getKeystrokesOnly())
{
// We have keyboard focus, and it's not an accelerator
- if (key < 0x80)
+ if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown())
+ {
+ return keyboard_focus->handleKey(key, mask, FALSE );
+ }
+ else if (key < 0x80)
{
// Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first.
- return (gFocusMgr.getKeyboardFocus() != NULL);
+ return (keyboard_focus != NULL);
}
}
@@ -2606,7 +2621,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
return TRUE;
}
- LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
// give menus a chance to handle modified (Ctrl, Alt) shortcut keys before current focus
// as long as focus isn't locked
@@ -2632,7 +2646,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// give floaters first chance to handle TAB key
// so frontmost floater gets focus
// if nothing has focus, go to first or last UI element as appropriate
- if (key == KEY_TAB && (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL))
+ if (key == KEY_TAB && (mask & MASK_CONTROL || keyboard_focus == NULL))
{
LL_WARNS() << "LLviewerWindow::handleKey give floaters first chance at tab key " << LL_ENDL;
if (gMenuHolder) gMenuHolder->hideMenus();