Commit 30630fc9 authored by aroben's avatar aroben

Reviewed by Maciej.

        Let Windows determine which mouse button is pressed.

        * platform/PlatformMouseEvent.h: Add message parameter to constructor.
        * platform/win/MouseEventWin.cpp:
        (WebCore::PlatformMouseEvent::PlatformMouseEvent): Use message
        parameter to determine which mouse button is pressed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d3da1eb3
2006-10-02 Adam Roben <aroben@apple.com>
Reviewed by Maciej.
Let Windows determine which mouse button is pressed.
* platform/PlatformMouseEvent.h: Add message parameter to constructor.
* platform/win/MouseEventWin.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent): Use message
parameter to determine which mouse button is pressed.
2006-10-02 Justin Garcia <justin.garcia@apple.com>
Reviewed by anders
......@@ -39,6 +39,7 @@ class NSEvent;
#if PLATFORM(WIN)
typedef struct HWND__* HWND;
typedef unsigned UINT;
typedef unsigned WPARAM;
typedef long LPARAM;
#endif
......@@ -99,7 +100,7 @@ namespace WebCore {
PlatformMouseEvent(NSEvent*);
#endif
#if PLATFORM(WIN)
PlatformMouseEvent(HWND, WPARAM, LPARAM);
PlatformMouseEvent(HWND, UINT, WPARAM, LPARAM);
void setClickCount(int count) { m_clickCount = count; }
#endif
#if PLATFORM(GDK)
......
......@@ -50,7 +50,7 @@ static IntPoint globalPositionForEvent(HWND hWnd, LPARAM lParam)
return point;
}
PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, WPARAM wParam, LPARAM lParam)
PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
: m_position(positionForEvent(hWnd, lParam))
, m_globalPosition(globalPositionForEvent(hWnd, lParam))
, m_clickCount(0)
......@@ -59,12 +59,23 @@ PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, WPARAM wParam, LPARAM lParam)
, m_altKey(GetAsyncKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT)
, m_metaKey(m_altKey) // FIXME: We'll have to test other browsers
{
if (wParam & MK_LBUTTON)
switch (message) {
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_LBUTTONDBLCLK:
m_button = LeftButton;
else if (wParam & MK_RBUTTON)
break;
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_RBUTTONDBLCLK:
m_button = RightButton;
else if (wParam & MK_MBUTTON)
break;
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MBUTTONDBLCLK:
m_button = MiddleButton;
break;
}
if (m_button == LeftButton) {
DWORD curTime = GetTickCount();
......
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