From 5a09886a44bb74c403a6223851dc6f0a1129d5ce Mon Sep 17 00:00:00 2001 From: Sebastien Benard Date: Thu, 7 Jul 2022 11:22:24 +0200 Subject: [PATCH] Fixed EOut/Eover window events for JS target --- hxd/Window.js.hx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hxd/Window.js.hx b/hxd/Window.js.hx index b6abd48fa..6a920c4d4 100644 --- a/hxd/Window.js.hx +++ b/hxd/Window.js.hx @@ -85,6 +85,7 @@ class Window { element.addEventListener("mousedown", onMouseDown); element.addEventListener("mouseup", onMouseUp); + element.addEventListener("mouseenter", onMouseEnter); element.addEventListener("mouseleave", onMouseLeave); element.addEventListener("wheel", onMouseWheel); element.addEventListener("touchstart", onTouchStart); @@ -297,13 +298,13 @@ class Window { event(ev); } + function onMouseEnter(e:js.html.MouseEvent) { + var ev = new Event(EOver, mouseX, mouseY); + event(ev); + } + function onMouseLeave(e:js.html.MouseEvent) { - var ev = new Event(EReleaseOutside, mouseX, mouseY); - ev.button = switch( e.button ) { - case 1: 2; - case 2: 1; - case x: x; - }; + var ev = new Event(EOut, mouseX, mouseY); event(ev); }