mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
jso: add InputEvent (#902)
This commit is contained in:
parent
8c15885f44
commit
2805631025
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2024 ihromant.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.dom.events;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface InputEvent extends Event {
|
||||||
|
@JSProperty
|
||||||
|
String getData();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getInputType();
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2024 ihromant.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.dom.events;
|
||||||
|
|
||||||
|
public interface InputEventTarget extends EventTarget {
|
||||||
|
default Registration onInput(EventListener<InputEvent> listener) {
|
||||||
|
return onEvent("input", listener);
|
||||||
|
}
|
||||||
|
}
|
|
@ -80,6 +80,9 @@ public interface MouseEvent extends Event {
|
||||||
@JSProperty
|
@JSProperty
|
||||||
double getMovementY();
|
double getMovementY();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getDetail();
|
||||||
|
|
||||||
void initMouseEvent(String type, boolean canBubble, boolean cancelable, JSObject view, int detail, int screenX,
|
void initMouseEvent(String type, boolean canBubble, boolean cancelable, JSObject view, int detail, int screenX,
|
||||||
int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey,
|
int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey,
|
||||||
short button, EventTarget relatedTarget);
|
short button, EventTarget relatedTarget);
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.teavm.jso.JSProperty;
|
||||||
import org.teavm.jso.dom.css.ElementCSSInlineStyle;
|
import org.teavm.jso.dom.css.ElementCSSInlineStyle;
|
||||||
import org.teavm.jso.dom.events.EventTarget;
|
import org.teavm.jso.dom.events.EventTarget;
|
||||||
import org.teavm.jso.dom.events.FocusEventTarget;
|
import org.teavm.jso.dom.events.FocusEventTarget;
|
||||||
|
import org.teavm.jso.dom.events.InputEventTarget;
|
||||||
import org.teavm.jso.dom.events.KeyboardEventTarget;
|
import org.teavm.jso.dom.events.KeyboardEventTarget;
|
||||||
import org.teavm.jso.dom.events.LoadEventTarget;
|
import org.teavm.jso.dom.events.LoadEventTarget;
|
||||||
import org.teavm.jso.dom.events.MouseEventTarget;
|
import org.teavm.jso.dom.events.MouseEventTarget;
|
||||||
|
@ -32,7 +33,8 @@ import org.teavm.jso.dom.xml.NodeList;
|
||||||
import org.teavm.jso.popover.ToggleEventTarget;
|
import org.teavm.jso.popover.ToggleEventTarget;
|
||||||
|
|
||||||
public abstract class HTMLElement implements Element, ElementCSSInlineStyle, EventTarget, FocusEventTarget,
|
public abstract class HTMLElement implements Element, ElementCSSInlineStyle, EventTarget, FocusEventTarget,
|
||||||
MouseEventTarget, WheelEventTarget, KeyboardEventTarget, LoadEventTarget, TouchEventTarget, ToggleEventTarget {
|
MouseEventTarget, WheelEventTarget, KeyboardEventTarget, LoadEventTarget, TouchEventTarget, ToggleEventTarget,
|
||||||
|
InputEventTarget {
|
||||||
@Override
|
@Override
|
||||||
public abstract NodeList<? extends HTMLElement> getElementsByTagName(String name);
|
public abstract NodeList<? extends HTMLElement> getElementsByTagName(String name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user