Add Touch Event. Fixes issue #579#580
Open
coder111111 wants to merge 1 commit intokonsoletyper:masterfrom
Open
Add Touch Event. Fixes issue #579#580coder111111 wants to merge 1 commit intokonsoletyper:masterfrom
coder111111 wants to merge 1 commit intokonsoletyper:masterfrom
Conversation
konsoletyper
requested changes
Jan 31, 2022
| public interface Touch extends JSObject { | ||
|
|
||
| @JSProperty | ||
| long getIdentifier(); |
Owner
There was a problem hiding this comment.
This won't work. JavaScript does not provide int64 type (or at least, did not provide by the time touch event spec was written). I'd replaced this with int, but you should test on real use cases if int fits well or you need double.
|
|
||
| // From https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent | ||
|
|
||
| public interface TouchEvent extends Event { |
Owner
There was a problem hiding this comment.
Ok, you created an event class. But how one's to use it. What about declaring corresponding event target interface, like I did it with MouseEventTarget, for example?
| JSArray<Touch> getChangedTouches(); | ||
|
|
||
| @JSProperty | ||
| JSArray<Touch> getTargetTouches(); |
Owner
There was a problem hiding this comment.
- Is it really necessary to expose this property as
JSArray? What about justTouch[]? - If you still want JS native type, consider
JSArrayReader<Touch>here
Ihromant
added a commit
to Ihromant/teavm
that referenced
this pull request
Nov 23, 2023
Contributor
|
This PR can be closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
I wanted to play with touch events today, so I added them myself. Please review code and merge upstream if you like it.
--Coder