mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-27 08:09:22 +00:00
The two handlers that turn changes of the hidden text field into key events lived in the page widget and called the bridge directly, so they could not be run in a test. They are moved, unchanged, into lib/mobile/soft_keyboard/ and now return what should be sent instead of sending it. Tests pin what they do, the known failures included (#16632, #7727, #16535). What changes around them: - The page listens to the text controller instead of onChanged. The handlers still act only when the text changes, as before. A test runs them both ways behind a real text field and compares the results. - When the field loses focus it is refilled and interpretation starts over. A change that reaches the controller while the field has no focus is ignored. The framework makes one when it clears the composing range of a field that lost focus. - What the handlers return is sent through a queue. Text waits until the Backspaces in front of it have returned. The bridge runs calls on four worker threads, so a Backspace followed by text, which the iOS handler has always produced, was not guaranteed to reach the session in that order. InputModel.inputKey returns the future of its call for this. Keys sent from elsewhere, the toolbar for instance, do not go through the queue. An interpreter can also ask for the field to be corrected, with SoftKeyboardSetField. Neither old handler uses it. It is there for one that has to put padding back or move the caret, as in #17002. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs