core: Dispatch textInput to focused non-TextField objects - #24151
Conversation
|
We can't accept code without tests, this applies to every PR you've sent (as mentioned in previous PRs). Also, we require a human to be in the loop, and your submissions look 100% automated. |
I am the "human in the loop" you mentioned, in the sense that the fixes stem from bugs or improvements I am personally discovering and testing as I go. Unfortunately, I lack the time to develop tests systematically, which is why I try to attach at least a code example for testing purposes to the PR. Sadly, that is the best I can do for now. If the conditions for accepting the PR aren't met, that’s fine. Would you still be interested in having the PR submitted—if only to give you the chance to pick up useful ideas? Otherwise, I’ll refrain from opening it and simply keep the branches available for an "enterprise build" I’ve already set up in my fork. |
|
We are open to code contributions, but we cannot just accept code unconditionally. Generating hundreds of lines docs using LLMs is not enough. Frankly, such docs are not even useful, because what can we do with them? They contain hundreds of claims that something works this way or that way, but who's gonna verify that? This requires immense effort from our side, and at this point I'm not sure if anyone is ever going to try to make it. If you want to get your code merged to Ruffle, the first thing you need to do is write tests which verify your claims. Only then we can talk about the code. If your plan is to just throw thousands of lines of AI-generated code at us and expect it to get merged unconditionally, that is not gonna happen. We can use AI tools as well, the reason we require a human in the loop is that generating code with LLMs is only a tiny part of the contribution. If you're not gonna do the rest, someone else will have to, or no one will. If your contribution is finding bugs and analyzing root causes and you absolutely don't care about the rest, you should focus on filing issues and describing bugs you've found, not filing PRs with untested, SWF-specific, AI-generated code. |
It seems to me that you enjoy being argumentative. First of all, I have no expectation that you integrate anything. I don't necessarily need you to accept the PRs; I submit them primarily as a courtesy to the community. So, your tone is out of line—at the very least, you could simply say "no thanks." Furthermore, you keep claiming that I’m adding thousands of untested lines of code, even though I just told you that I rigorously test everything I submit. You should be grateful to have someone testing your high-quality code against real-world enterprise workloads, rather than just Flash games. Finally, it isn't true that they always involve thousands of lines of code; some PRs fix bugs or address basic gaps in the Ruffle codebase and consist of just a few lines—meaning a maintainer could integrate them in five minutes, if you're interested in doing so. You’ve said everything except answer my one question: are you interested in having the PRs submitted—so that at least some of you have the chance to evaluate them—or not? Please answer yes or no. Thanks. |
f8d11a0 to
0843dff
Compare
Typed characters were delivered only when a native TextField held focus (via FocusTracker::get_as_edit_text). When any other interactive object had focus — for example a Sprite hosting a Text Layout Framework EditManager, as used by the Flex Spark TextInput/TextArea/ComboBox controls — the character was dropped and the component could not be typed into. Flash Player dispatches a flash.events.TextEvent of type TEXT_INPUT to whatever InteractiveObject holds focus, which is how such components receive keyboard input. Mirror that: when the focused object is an ActionScript 3 interactive object other than a native text field, dispatch a bubbling, cancelable textInput TextEvent to it. The existing native EditText path is unchanged, and raw KeyboardEvents already reached focused objects, so only character input was missing.
0843dff to
523d42e
Compare
Summary
Typed characters were only delivered to native text fields. When any other
interactive object held focus — in particular a
Spriterunning a Text LayoutFramework
EditManager, as used by Flex SparkTextInput/TextArea/ComboBox— the character was dropped, so those controls displayed theircontent but could not be typed into.
Flash Player dispatches a
flash.events.TextEventof typeTEXT_INPUTtowhatever
InteractiveObjecthas focus. This makes Ruffle do the same.Root cause
In
player.rs, character input, text-control and IME events were routed to thefocused object only when it was a native
EditText:FocusTracker::get_as_edit_text()returnsSomeonly for a nativeEditText.When focus was on any other object the whole block was skipped and the character
was discarded — it was never dispatched anywhere. Raw
KeyboardEvents were notgated this way (they already reached the focused object), so navigation keys
arrived but the character content did not.
Reproduction
Minimal AS3: a focused
Spritethat listens forTEXT_INPUT. Before this patchtyping produces nothing; after it, each keystroke is delivered.
Fix
Turn the block into an
if/else if: the nativeEditTextpath is unchangedand still handled first; when the focused object is an ActionScript 3 interactive
object other than a text field, dispatch a bubbling, cancelable
textInputTextEventto it (built with the same helper the native path uses). Dispatch isgated to AS3 targets, consistent with the neighbouring
KeyboardEventcode.Because an
EditTextis always caught by the first branch, its native insertion,its own
textInputdispatch, restrict filtering and IME/text-control handlingare byte-for-byte the same as before. The new branch runs only for focused
objects that previously received nothing, so the change is strictly additive.
Notes
KeyboardEvents already reached focused objects, so arrow/navigation keys wereunaffected; only the character channel was missing.
follow-up (they still take the native
EditTextpath). Latin/ASCII typing — thereported gap — is fully covered.
Checklist