summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llkeyboardwin32.cpp2
-rw-r--r--indra/llwindow/llwindowwin32.cpp24
2 files changed, 23 insertions, 3 deletions
diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp
index 35a3e7621a..ab5ecb4e63 100644
--- a/indra/llwindow/llkeyboardwin32.cpp
+++ b/indra/llwindow/llkeyboardwin32.cpp
@@ -80,7 +80,7 @@ LLKeyboardWin32::LLKeyboardWin32()
mTranslateKeyMap[VK_OEM_COMMA] = ',';
mTranslateKeyMap[VK_OEM_MINUS] = '-';
mTranslateKeyMap[VK_OEM_PERIOD] = '.';
- mTranslateKeyMap[VK_OEM_2] = KEY_PAD_DIVIDE;
+ mTranslateKeyMap[VK_OEM_2] = '/';//This used to be KEY_PAD_DIVIDE, but that breaks typing into text fields in media prims
mTranslateKeyMap[VK_OEM_3] = '`';
mTranslateKeyMap[VK_OEM_4] = '[';
mTranslateKeyMap[VK_OEM_5] = '\\';
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 7bc0056d8f..439c10c95c 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2198,7 +2198,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONUP");
LLFastTimer t2(FTM_MOUSEHANDLER);
- // Because we move the cursor position in tllviewerhe app, we need to query
+ // Because we move the cursor position in the llviewer 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
@@ -2228,7 +2228,27 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MOUSEWHEEL");
static short z_delta = 0;
- z_delta += HIWORD(w_param);
+ RECT client_rect;
+
+ // eat scroll events that occur outside our window, since we use mouse position to direct scroll
+ // instead of keyboard focus
+ // NOTE: mouse_coord is in *window* coordinates for scroll events
+ POINT mouse_coord = {(S32)(S16)LOWORD(l_param), (S32)(S16)HIWORD(l_param)};
+
+ if (ScreenToClient(window_imp->mWindowHandle, &mouse_coord)
+ && GetClientRect(window_imp->mWindowHandle, &client_rect))
+ {
+ // we have a valid mouse point and client rect
+ if (mouse_coord.x < client_rect.left || client_rect.right < mouse_coord.x
+ || mouse_coord.y < client_rect.top || client_rect.bottom < mouse_coord.y)
+ {
+ // mouse is outside of client rect, so don't do anything
+ return 0;
+ }
+ }
+
+ S16 incoming_z_delta = HIWORD(w_param);
+ z_delta += incoming_z_delta;
// cout << "z_delta " << z_delta << endl;
// current mouse wheels report changes in increments of zDelta (+120, -120)