Commit 255b3011 authored by hyatt's avatar hyatt

Add support for horizontal mouse wheeling (WebKit part).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23563 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8198af88
2007-06-18 Dave Hyatt <hyatt@apple.com>
Add support for horizontal mouse wheeling to Windows. Shift+wheel is supported for horizontal
wheeling just like on OS X. In addition, the WM_MOUSEHWHEEL event is now processed correctly so that
input devices like tilt wheels will now work.
Reviewed by aroben
* WebView.cpp:
(WebView::mouseWheel):
(WebViewWndProc):
* WebView.h:
2007-06-17 Dave Hyatt <hyatt@apple.com>
Add support for Ctrl+Mouse Wheel to increase/decrease text zoom (Win32 only).
......
......@@ -99,6 +99,7 @@ using std::min;
const LPCWSTR kWebViewWindowClassName = L"WebViewWindowClass";
const int WM_XP_THEMECHANGED = 0x031A;
const int WM_VISTA_MOUSEHWHEEL = 0x020E;
static ATOM registerWebView();
static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
......@@ -839,7 +840,7 @@ bool WebView::handleMouseEvent(UINT message, WPARAM wParam, LPARAM lParam)
return handled;
}
bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam)
bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isHorizontal)
{
// Ctrl+Mouse wheel doesn't ever go into WebCore. It is used to
// zoom instead (Mac zooms the whole Desktop, but Windows browsers trigger their
......@@ -853,7 +854,7 @@ bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam)
return true;
}
PlatformWheelEvent wheelEvent(m_viewWindow, wParam, lParam);
PlatformWheelEvent wheelEvent(m_viewWindow, wParam, lParam, isHorizontal);
Frame* coreFrame = core(m_mainFrame);
if (!coreFrame)
return false;
......@@ -1187,9 +1188,10 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
handled = webView->handleMouseEvent(message, wParam, lParam);
break;
case WM_MOUSEWHEEL:
case WM_VISTA_MOUSEHWHEEL:
if (Frame* coreFrame = core(mainFrameImpl))
if (coreFrame->view()->didFirstLayout())
handled = webView->mouseWheel(wParam, lParam);
handled = webView->mouseWheel(wParam, lParam, (wParam & MK_SHIFT) || message == WM_VISTA_MOUSEHWHEEL);
break;
case WM_KEYDOWN:
handled = webView->keyDown(wParam, lParam);
......
......@@ -613,7 +613,7 @@ public:
bool onUninitMenuPopup(WPARAM, LPARAM);
void performContextMenuAction(WPARAM, LPARAM);
void inspectElement(const WebCore::HitTestResult&);
bool mouseWheel(WPARAM, LPARAM);
bool mouseWheel(WPARAM, LPARAM, bool isHorizontal);
bool execCommand(WPARAM wParam, LPARAM lParam);
bool keyDown(WPARAM, LPARAM);
bool keyUp(WPARAM, LPARAM);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment