Open angelosilvestre opened 1 year ago
@cbracken Do you know if Flutter is calling some native Mac API to show this accent menu in the engine? If so then it shouldn't be too hard to expose this programmatically to the framework.
The triaged-design
label is irrelevant if there is no team-design
label or fyi-design
label.
This is handled entirely by macOS (other than all the work that @LongCatIsLooong did to ensure we're not stealing input for arrow keys/numbers). I suspect that dismissing this should be identical to dismissing the IME composing candidates list. I suspect if there's a means to do that, we'll find it in InputMethodKit. Maybe [InputMethodController hidePalettes
]?
@cbracken Thank you for the insight here!
Does it work if you handle DeleteCharacterIntent
instead of intercepting key events? As @cbracken mentioned the IME should be the one handling the accent menu, and if the backspace key event is intercepted by FocusNode.onKey
, then the IME won't be able to close it.
@LongCatIsLooong Using DeleteCharacterIntent
doesn't work because the Shortcuts
widget also intercepts key events on FocusNode.onKey
.
On macOS if I remember correctly it's not using a Shortcuts
widget. Shortcuts
uses / depends on Intent
/Actions
stuff, not the other way around.
The triaged-desktop
label is irrelevant if there is no team-desktop
label or fyi-desktop
label.
Is there an existing issue for this?
Use case
In super_editor, we handle text input by using both
TextInputClient
(with delta model enabled) andFocusNode
'sonKey
.We need to handle key events because some operations generates text editing deltas and others don't. For example, typing a character generates a
TextEditingDeltaInsertion
, but pressing BACKSPACE don't. Because of that, we handle the BACKSPACE key event to delete a character upstream.By handling the BACKSPACE key event we have the following issue:
After pressing and holding a letter, macOS shows the accent panel:
By pressing BACKSPACE, the panel should close. However, as we handled the BACKSPACE key event, the panel stays open.
Proposal
Provide a method in
TextInputConnection
so we can close the accent panel after handling the key event.