Commit f33b58d0 by Corentin Wallez

Win32Window: Implement Event::EVENT_MOUSE_ENTERED

BUG=angleproject:1000 Change-Id: I9b61564fa086318c3ffa9a6b85bb100c52cfad54 Reviewed-on: https://chromium-review.googlesource.com/316590Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 6beb0bfd
......@@ -228,7 +228,7 @@ Key VirtualKeyCodeToKey(WPARAM key, LPARAM flags)
return Key(0);
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
......@@ -444,6 +444,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE:
{
if (!window->mIsMouseInWindow)
{
window->mIsMouseInWindow = true;
Event event;
event.Type = Event::EVENT_MOUSE_ENTERED;
window->pushEvent(event);
}
int mouseX = static_cast<short>(LOWORD(lParam));
int mouseY = static_cast<short>(HIWORD(lParam));
......@@ -460,6 +468,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Event event;
event.Type = Event::EVENT_MOUSE_LEFT;
window->pushEvent(event);
window->mIsMouseInWindow = false;
break;
}
......@@ -478,6 +487,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Win32Window::Win32Window()
: mIsVisible(false),
mSetVisibleTimer(CreateTimer()),
mIsMouseInWindow(false),
mNativeWindow(0),
mParentWindow(0),
mNativeDisplay(0)
......
......@@ -41,12 +41,16 @@ class Win32Window : public OSWindow
void signalTestEvent() override;
private:
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
std::string mParentClassName;
std::string mChildClassName;
bool mIsVisible;
Timer *mSetVisibleTimer;
bool mIsMouseInWindow;
EGLNativeWindowType mNativeWindow;
EGLNativeWindowType mParentWindow;
EGLNativeDisplayType mNativeDisplay;
......
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