summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-06-13 18:02:37 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-06-13 18:02:37 +0000
commitf118e7c80b95d8c0a0c8abb14ff379b6697e01b6 (patch)
treedb55a74f8d18b3c366608a537e2a32f6d089d56f /indra/llwindow
parent680667d4bdca7e2a6df15cd6f16f34c12c97da8e (diff)
result of merge manually performed through diff and patch. svn diff svn+ssh://svn/svn/linden/release@63615 svn+ssh://svn/svn/linden/branches/release-candidate@63637 | patch -p0 in release
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindow.cpp10
-rw-r--r--indra/llwindow/llwindow.h2
-rw-r--r--indra/llwindow/llwindowmacosx.cpp8
-rw-r--r--indra/llwindow/llwindowsdl.cpp9
-rw-r--r--indra/llwindow/llwindowwin32.cpp49
5 files changed, 74 insertions, 4 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index f7df94c65c..650398cb65 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -105,6 +105,16 @@ BOOL LLWindowCallbacks::handleRightMouseUp(LLWindow *window, const LLCoordGL pos
return FALSE;
}
+BOOL LLWindowCallbacks::handleMiddleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask)
+{
+ return FALSE;
+}
+
+BOOL LLWindowCallbacks::handleMiddleMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask)
+{
+ return FALSE;
+}
+
BOOL LLWindowCallbacks::handleActivate(LLWindow *window, BOOL activated)
{
return FALSE;
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 5c5f712b32..6e26285e29 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -76,6 +76,8 @@ public:
virtual void handleQuit(LLWindow *window);
virtual BOOL handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
virtual BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
+ virtual BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
+ virtual BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
virtual BOOL handleActivate(LLWindow *window, BOOL activated);
virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask);
virtual void handleScrollWheel(LLWindow *window, S32 clicks);
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 4152de51c5..62743d4d08 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -2157,6 +2157,10 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
case kEventMouseButtonSecondary:
mCallbacks->handleRightMouseDown(this, outCoords, mask);
break;
+
+ case kEventMouseButtonTertiary:
+ mCallbacks->handleMiddleMouseDown(this, outCoords, mask);
+ break;
}
result = noErr;
break;
@@ -2179,6 +2183,10 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
case kEventMouseButtonSecondary:
mCallbacks->handleRightMouseUp(this, outCoords, mask);
break;
+
+ case kEventMouseButtonTertiary:
+ mCallbacks->handleMiddleMouseUp(this, outCoords, mask);
+ break;
}
result = noErr;
break;
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 71c766db8e..6c1ee967df 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -2032,7 +2032,9 @@ void LLWindowSDL::gatherInput()
}
else if (event.button.button == SDL_BUTTON_MIDDLE) // middle
- ; // Middle mouse isn't handled right now in Second Life ... mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask);
+ {
+ mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask);
+ }
else if (event.button.button == 4) // mousewheel up...thanks to X11 for making SDL consider these "buttons".
mCallbacks->handleScrollWheel(this, -1);
else if (event.button.button == 5) // mousewheel down...thanks to X11 for making SDL consider these "buttons".
@@ -2053,8 +2055,9 @@ void LLWindowSDL::gatherInput()
else if (event.button.button == SDL_BUTTON_RIGHT) // right ... yes, it's 3, not 2, in SDL...
mCallbacks->handleRightMouseUp(this, openGlCoord, mask);
else if (event.button.button == SDL_BUTTON_MIDDLE) // middle
- ; // UNUSED IN SECOND LIFE RIGHT NOW mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask);
-
+ {
+ mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask);
+ }
// don't handle mousewheel here...
break;
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index e6bce27ce2..095b2113a7 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2052,7 +2052,54 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
break;
case WM_MBUTTONDOWN:
- // Handle middle button click
+// case WM_MBUTTONDBLCLK:
+ {
+ // Because we move the cursor position in tllviewerhe app, we need to query
+ // to find out where the cursor at the time the event is handled.
+ // If we don't do this, many clicks could get buffered up, and if the
+ // first click changes the cursor position, all subsequent clicks
+ // will occur at the wrong location. JC
+ LLCoordWindow cursor_coord_window;
+ if (window_imp->mMousePositionModified)
+ {
+ window_imp->getCursorPosition(&cursor_coord_window);
+ window_imp->convertCoords(cursor_coord_window, &gl_coord);
+ }
+ else
+ {
+ window_imp->convertCoords(window_coord, &gl_coord);
+ }
+ MASK mask = gKeyboard->currentMask(TRUE);
+ if (window_imp->mCallbacks->handleMiddleMouseDown(window_imp, gl_coord, mask))
+ {
+ return 0;
+ }
+ }
+ break;
+
+ case WM_MBUTTONUP:
+ {
+ // Because we move the cursor position in tllviewerhe app, we need to query
+ // to find out where the cursor at the time the event is handled.
+ // If we don't do this, many clicks could get buffered up, and if the
+ // first click changes the cursor position, all subsequent clicks
+ // will occur at the wrong location. JC
+ LLCoordWindow cursor_coord_window;
+ if (window_imp->mMousePositionModified)
+ {
+ window_imp->getCursorPosition(&cursor_coord_window);
+ window_imp->convertCoords(cursor_coord_window, &gl_coord);
+ }
+ else
+ {
+ window_imp->convertCoords(window_coord, &gl_coord);
+ }
+ MASK mask = gKeyboard->currentMask(TRUE);
+ if (window_imp->mCallbacks->handleMiddleMouseUp(window_imp, gl_coord, mask))
+ {
+ return 0;
+ }
+ }
break;
case WM_MOUSEWHEEL: