-
-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avm2: Use Line Feed character for textInput newline events #19517
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
public function onKeyDown(evt: KeyboardEvent): void { | ||
// TODO: We must not be firing this event yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this comment mean? Why can't you just fire the event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I misunderstood the comment. I thought we cannot fire the event here somehow.
The key down/up events are separate from text input events, you need to add them to input.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have a way of producing the TEXT_INPUT and KEY_DOWN event with just one line in input.json
? It seems a bit pointless to test if both results are basically hardcoded. (We also don't seem to support specifying a character for test KeyDown events, which is another problem)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have a way of producing the TEXT_INPUT and KEY_DOWN event with just one line in
input.json
?
Nope
It seems a bit pointless to test if both results are basically hardcoded.
Text input is inherently different from key up/down, because it goes through the OS (keyboard layout, mapping, etc.). We cannot infer one from the other, it's done outside of Ruffle.
We also don't seem to support specifying a character for test KeyDown events, which is another problem
I agree, I remember adding key char as an optional field in the automated event. Maybe I'll find the commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I remember now. I worked on redoing key events in Ruffle to properly support key mapping. I believe we should do it first, because key code can be inferred from key char (contrary to text input or maybe, when we have key char, I'm actually not sure).
TL;DR we need to refactor input a bit
Fixes #19482