diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-10-29 16:10:37 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-10-29 16:10:37 -0700 |
commit | 8357fe51aa034d823ba2f7c0465f4f8f8065fc1a (patch) | |
tree | 0edd109b064c387cf32257961731a07086c4dcf1 | |
parent | 4d1a2ef2d1d521ccdf5150f76ef5ce7597aded28 (diff) |
Added LLViewerMediaImpl::scrollWheel() to route scroll wheel events through the media impl.
The horizontal scroll arrows in the media controls now send horizontal scrollwheel events instead of arrow keys.
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 1 |
3 files changed, 23 insertions, 8 deletions
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index fb0b5dff1f..5ed4464c2e 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -885,11 +885,11 @@ void LLPanelPrimMediaControls::onScrollUp(void* user_data) LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); this_panel->focusOnTarget(); - LLPluginClassMedia* plugin = this_panel->getTargetMediaPlugin(); + LLViewerMediaImpl* impl = this_panel->getTargetMediaImpl(); - if(plugin) + if(impl) { - plugin->scrollEvent(0, -1, MASK_NONE); + impl->scrollWheel(0, -1, MASK_NONE); } } void LLPanelPrimMediaControls::onScrollUpHeld(void* user_data) @@ -906,7 +906,8 @@ void LLPanelPrimMediaControls::onScrollRight(void* user_data) if(impl) { - impl->handleKeyHere(KEY_RIGHT, MASK_NONE); + impl->scrollWheel(-1, 0, MASK_NONE); +// impl->handleKeyHere(KEY_RIGHT, MASK_NONE); } } void LLPanelPrimMediaControls::onScrollRightHeld(void* user_data) @@ -924,7 +925,8 @@ void LLPanelPrimMediaControls::onScrollLeft(void* user_data) if(impl) { - impl->handleKeyHere(KEY_LEFT, MASK_NONE); + impl->scrollWheel(1, 0, MASK_NONE); +// impl->handleKeyHere(KEY_LEFT, MASK_NONE); } } void LLPanelPrimMediaControls::onScrollLeftHeld(void* user_data) @@ -938,11 +940,11 @@ void LLPanelPrimMediaControls::onScrollDown(void* user_data) LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); this_panel->focusOnTarget(); - LLPluginClassMedia* plugin = this_panel->getTargetMediaPlugin(); + LLViewerMediaImpl* impl = this_panel->getTargetMediaImpl(); - if(plugin) + if(impl) { - plugin->scrollEvent(0, 1, MASK_NONE); + impl->scrollWheel(0, 1, MASK_NONE); } } void LLPanelPrimMediaControls::onScrollDownHeld(void* user_data) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 20e9208a4e..e2d9f5a2c9 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1119,6 +1119,18 @@ void LLViewerMediaImpl::mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button) } ////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::scrollWheel(S32 x, S32 y, MASK mask) +{ + scaleMouse(&x, &y); + mLastMouseX = x; + mLastMouseY = y; + if (mMediaSource) + { + mMediaSource->scrollEvent(x, y, mask); + } +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::onMouseCaptureLost() { if (mMediaSource) diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 76606be685..5444abf854 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -145,6 +145,7 @@ public: void mouseUp(const LLVector2& texture_coords, MASK mask, S32 button = 0); void mouseMove(const LLVector2& texture_coords, MASK mask); void mouseDoubleClick(S32 x,S32 y, MASK mask, S32 button = 0); + void scrollWheel(S32 x, S32 y, MASK mask); void mouseCapture(); void navigateBack(); |