Commit 8198af88 authored by hyatt's avatar hyatt

Add support for horizontal mouse wheeling (WebCore part).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23562 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 33aed6c7
2007-06-18 Dave Hyatt <hyatt@apple.com>
Add support for horizontal mouse wheeling on Windows.
Reviewed by aroben
* platform/PlatformWheelEvent.h:
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
2007-06-17 Sam Weinig <sam@webkit.org>
Win32 build fix.
......@@ -82,7 +82,7 @@ namespace WebCore {
PlatformWheelEvent(NSEvent*);
#endif
#if PLATFORM(WIN)
PlatformWheelEvent(HWND, WPARAM, LPARAM);
PlatformWheelEvent(HWND, WPARAM, LPARAM, bool isHorizontal);
#endif
#if PLATFORM(GDK)
PlatformWheelEvent(GdkEvent*);
......
......@@ -45,11 +45,9 @@ static IntPoint globalPositionForEvent(HWND hWnd, LPARAM lParam)
return point;
}
PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, WPARAM wParam, LPARAM lParam)
PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, WPARAM wParam, LPARAM lParam, bool isHorizontal)
: m_position(positionForEvent(hWnd, lParam))
, m_globalPosition(globalPositionForEvent(hWnd, lParam))
, m_deltaX(0) // FIXME: We may want to map a key + wheel to be horizontal scrolling (like OS X)
, m_deltaY(short(HIWORD(wParam)) / 120.0f)
, m_isAccepted(false)
, m_shiftKey(wParam & MK_SHIFT)
, m_ctrlKey(wParam & MK_CONTROL)
......@@ -57,6 +55,14 @@ PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, WPARAM wParam, LPARAM lParam)
, m_metaKey(m_altKey) // FIXME: We'll have to test other browsers
, m_isContinuous(false)
{
float delta = short(HIWORD(wParam)) / (float)WHEEL_DELTA;
if (isHorizontal) {
m_deltaX = delta;
m_deltaY = 0;
} else {
m_deltaX = 0;
m_deltaY = delta;
}
}
}
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