-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Display Emojis, Kaomojis, and symbols while in IME mode #4688
Conversation
|
||
// width is cursor to end of canvas | ||
_textBlock.Width(200); // TODO GitHub #3640: Determine proper Width |
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.
Since this got removed, what happens if your composition text is larger than the width of the buffer? Do we just start writing off the end of the window?
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.
Yup, it'll start writing off the end of the window, which actually is the current behavior. Until text wrap-around is implemented, the composition text will always write off the end of the window. Removing this just allows the user to be able to see as much composition text as the window is wide (or until the user resizes the window to make it wider).
void TSFInputControl::_SendAndClearText() | ||
{ | ||
// call event handler with data handled by parent | ||
_compositionCompletedHandlers(_inputBuffer); |
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.
Dumb q: the textblock is relaid-out between these events, right? When composition "completes" without starting, that is?
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.
Yup, the textblock actually seems to get relaid-out constantly between just about all events, such as TextUpdate, CompositionStarted, or CompositionCompleted events.
Hello @leonMSFT! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Summary of the Pull Request
Currently, while in IME mode, selections with the Emoji/Kaomoji/Symbol Picker (which is brought up with win+.) are not displayed until the user starts a new composition. This is due to the fact that we hide the TextBlock when we receive a CompositionCompleted event, and we only show the TextBlock when we receive a CompositionStarted event. Input from the picker does not count as a composition, so we were never showing the text box, even if the symbols were thrown into the inputBuffer. In addition, we weren't receiving CompositionStarted events when we expected to.
We should be showing the TextBlock when we receive any text, so we should make the TextBlock visible inside of
TextUpdatingHandler
. Furthermore, some really helpful discussion in #3745 around wrapping theNotifyTextChanged
call with aNotifyFocusLeave
and aNotifyFocusEnter
allowed the control to much more consistently determine when a CompositionStarted and a CompositionEnded.I've also went around and replaced casts with saturating casts, and have removed the line that sets the
textBlock.Width()
so that it would automatically set its width. This resolves the issue where while composing a sentence, the textBlock would be too small to contain all the text, so it would be cut off, but the composition is still valid and still able to continue.PR Checklist
Validation Steps Performed
Tested picking emojis, kaomojis, and symbols with numerous different languages.