diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java b/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java index 76187622c..7b8efa2ef 100644 --- a/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java +++ b/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java @@ -41,6 +41,18 @@ public interface MouseEvent extends Event { @JSProperty int getClientY(); + @JSProperty + int getOffsetX(); + + @JSProperty + int getOffsetY(); + + @JSProperty + int getPageX(); + + @JSProperty + int getPageY(); + @JSProperty boolean getCtrlKey(); @@ -56,6 +68,9 @@ public interface MouseEvent extends Event { @JSProperty short getButton(); + @JSProperty + short getButtons(); + @JSProperty EventTarget getRelatedTarget(); diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEventTarget.java b/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEventTarget.java index c2c2c9475..7c296551e 100644 --- a/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEventTarget.java +++ b/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEventTarget.java @@ -48,6 +48,14 @@ public interface MouseEventTarget extends EventTarget { removeEventListener("mouseup", listener); } + default void listenMouseMove(EventListener listener) { + addEventListener("mousemove", listener); + } + + default void neglectMouseMove(EventListener listener) { + removeEventListener("mousemove", listener); + } + default void listenMouseOver(EventListener listener) { addEventListener("mouseover", listener); } @@ -64,7 +72,7 @@ public interface MouseEventTarget extends EventTarget { removeEventListener("mouseenter", listener); } - default void listenMouseLeaeve(EventListener listener) { + default void listenMouseLeave(EventListener listener) { addEventListener("mouseleave", listener); }