JS: add missing mouseevent methods (#542)

This commit is contained in:
Ivan Hetman 2020-11-23 10:47:30 +02:00 committed by GitHub
parent b718e7852f
commit bec0f44869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

@ -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();

View File

@ -48,6 +48,14 @@ public interface MouseEventTarget extends EventTarget {
removeEventListener("mouseup", listener);
}
default void listenMouseMove(EventListener<MouseEvent> listener) {
addEventListener("mousemove", listener);
}
default void neglectMouseMove(EventListener<MouseEvent> listener) {
removeEventListener("mousemove", listener);
}
default void listenMouseOver(EventListener<MouseEvent> listener) {
addEventListener("mouseover", listener);
}
@ -64,7 +72,7 @@ public interface MouseEventTarget extends EventTarget {
removeEventListener("mouseenter", listener);
}
default void listenMouseLeaeve(EventListener<MouseEvent> listener) {
default void listenMouseLeave(EventListener<MouseEvent> listener) {
addEventListener("mouseleave", listener);
}