You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, user events related to text editing are handled by a bunch of disparate code that could be consolidated. For example, there is a RawKeyboard listener in RenderEditable in addition to our built-in keyboard Shortcuts system.
Key events should be consolidated into Shortcuts. Mouse, tap, and other events should dispatch Intents that are handled the same way that the keyboard Intents are handled.
When we've got some mouse/tap Actions being overridden, then an example of overriding these should be added to TextEditingActions. I've removed the original one I had there for now.
Code
////// {@tool snippet}////// This example shows how to use an additional [Actions] widget to override/// the left arrow key [Intent] and make it move the cursor to the right/// instead.////// ```dart/// final TextEditingController controller = TextEditingController(/// text: "Try using the keyboard's arrow keys and notice that left moves right.",/// );////// @override/// Widget build(BuildContext context) {/// return Scaffold(/// body: Center(/// child: Actions(/// actions: <Type, Action<Intent>>{/// ArrowLeftTextIntent: TextEditingAction<ArrowLeftTextIntent>(/// onInvoke: (ArrowLeftTextIntent intent, EditableTextState editableTextState) {/// editableTextState.renderEditable.moveSelectionRight(SelectionChangedCause.keyboard);/// },/// ),/// },/// child: TextField(/// controller: controller,/// ),/// ),/// ),/// );/// }/// ```/// {@end-tool}
Does this Text Editing Shortcuts/Intents/Actions in composing input mode for other languages such as Japanese and Chinese has been considered?
Background
I am developing a flutter application with text input, However, it is found that the current TextField of flutter has serious experience problems on the macos platform in Chinese and Japanese input.
Chinese and Japanese input methods will have a special place, they need to rely on multiple letters for combined input. which was named Compsing in flutter and MarkedText in macOS
For example, in Chinese Pinyin - Simplified inpu mode
when you typed letters ni in sequence, which a floating window will appear on theTextField with candidate text related to the letters which you just input(ni), and the first charater would be 你.
the MoveSelectionDownTextIntent has intercepted arrow down key event during in composing state. As a result, the arrow up and arrow down keys cannot be used to expand the floating window for combined candidate text selection.
I tried to solve the above problem by modifying the flutter engine. Although the problem was temporarily resolved. But I still hope that flutter's text input framework takes into account the composed text input processing from the beginning of its design , in this way can the flutter framework be more usable.
@boyan01 Thanks for the detailed comment! We are trying to ensure that composing keyboards work on all of Flutter's platforms. I can confirm that problem 2 is broken for me too. I've created an issue for it here: #85328
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
justinmc commentedon Feb 13, 2021
When we've got some mouse/tap Actions being overridden, then an example of overriding these should be added to TextEditingActions. I've removed the original one I had there for now.
Code
justinmc commentedon Mar 12, 2021
We've now got a system for handling text editing interactions with Shortcuts/Intents/Actions: #75032
For this issue to be complete, we still need:
boyan01 commentedon Jun 8, 2021
Does this Text Editing Shortcuts/Intents/Actions in composing input mode for other languages such as Japanese and Chinese has been considered?
Background
I am developing a flutter application with text input, However, it is found that the current
TextFieldof flutter has serious experience problems on the macos platform in Chinese and Japanese input.Chinese and Japanese input methods will have a special place, they need to rely on multiple letters for combined input. which was named
Compsingin flutter andMarkedTextin macOSFor example, in Chinese
Pinyin - Simplifiedinpu modewhen you typed letters
niin sequence, which a floating window will appear on theTextFieldwith candidate text related to the letters which you just input(ni), and the first charater would be你.This is an example of the video corresponding to the text input process described above.
https://user-images.githubusercontent.com/17426470/121132488-c9ecf800-c863-11eb-9e41-ff32204b5de8.mov
Current problem
DeleteTextIntentdid not support delete compsing text in macOS. [macOS] Backspace collapses composing region on macOS #78061flutter/packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Lines 344 to 349 in ba52081
MoveSelectionDownTextIntenthas interceptedarrow downkey event during in composing state. As a result, thearrow upandarrow downkeys cannot be used to expand the floating window for combined candidate text selection.flutter/packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Line 358 in ba52081
End
I tried to solve the above problem by modifying the flutter engine. Although the problem was temporarily resolved. But I still hope that flutter's text input framework takes into account the composed text input processing from the beginning of its design , in this way can the flutter framework be more usable.
justinmc commentedon Jun 25, 2021
@boyan01 Thanks for the detailed comment! We are trying to ensure that composing keyboards work on all of Flutter's platforms. I can confirm that problem 2 is broken for me too. I've created an issue for it here: #85328
justinmc commentedon Oct 1, 2021
Unassigning myself as @LongCatIsLooong is the one working on bringing this to mouse/tap gestures.
justinmc commentedon Jul 13, 2022
I'm going to close this now that the only work remaining is captured by #101151.
github-actions commentedon Jul 27, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.