summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webinputevent_win.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-10 06:42:49 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-10 06:42:49 +0000
commitbda00571b1638107491ac3eea8f340f1ae625f01 (patch)
tree7b71fc3fc292c710359e21db41dfecc107390d91 /webkit/glue/webinputevent_win.cc
parentab658b906c9aa82009364973bd58382a533e142d (diff)
downloadchromium_src-bda00571b1638107491ac3eea8f340f1ae625f01.zip
chromium_src-bda00571b1638107491ac3eea8f340f1ae625f01.tar.gz
chromium_src-bda00571b1638107491ac3eea8f340f1ae625f01.tar.bz2
Implements a WM_MOUSEHWHEEL message handler.
A change r2266 removed fake scroll bars used to handle WM_MOUSEWHEEL messages. This change prevents Windows from sending WM_HSCROLL messages when tilting a mouse wheel (Windows sends WM_HSCROLL messages only to a window which has scroll bars.) and this causes a regression problem that we cannot use tilt-wheel to scroll horizontally. To solve this problem, this change implements a WM_MOUSEHWHEEL (0x020E) message handler to dispatch tilt-wheel events to the RenderWidgetHostViewWin::OnWheelEvents() function. Also, It changes scroll direction in creating a WebMouseWheelEvent instance. Review URL: http://codereview.chromium.org/9319 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webinputevent_win.cc')
-rw-r--r--webkit/glue/webinputevent_win.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/webkit/glue/webinputevent_win.cc b/webkit/glue/webinputevent_win.cc
index b72bfc4..7933427 100644
--- a/webkit/glue/webinputevent_win.cc
+++ b/webkit/glue/webinputevent_win.cc
@@ -172,22 +172,14 @@ WebMouseWheelEvent::WebMouseWheelEvent(HWND hwnd, UINT message, WPARAM wparam,
break;
}
- // Windows sends the following messages for tilt-wheel events.
- // * Tilt a mousewheel (left)
- // message == WM_HSCROLL, wparam == SB_LINELEFT (== SB_LINEUP).
- // * Tilt a mousewheel (right)
- // message == WM_HSCROLL, wparam == SB_LINERIGHT (== SB_LINEDOWN).
- // To convert these events to the shift + mousewheel ones, we do not only
- // add a shift but also change the signs of their |wheel_delta| values.
- if (WM_HSCROLL == message) {
- key_state |= MK_SHIFT;
- wheel_delta = -wheel_delta;
- }
-
// Use GetAsyncKeyState for key state since we are synthesizing
// the input
get_key_state = GetAsyncKeyState;
} else {
+ // TODO(hbono): we should add a new variable which indicates scroll
+ // direction and remove this key_state hack.
+ if (WM_MOUSEHWHEEL == message)
+ key_state |= MK_SHIFT;
global_x = static_cast<short>(LOWORD(lparam));
global_y = static_cast<short>(HIWORD(lparam));