/* * かな漢字変換が終わって入力テキストが確定した。 */ private void EditContext_CompositionCompleted(CoreTextEditContext sender, CoreTextCompositionCompletedEventArgs ev) { StringWriter sw = new StringWriter(); // 文節ごとのテキスト位置と漢字の読みを得ます。 foreach (CoreTextCompositionSegment seg in ev.CompositionSegments) { sw.Write("({0},{1}):{2} ", seg.Range.StartCaretPosition, seg.Range.EndCaretPosition, seg.PreconversionString); } Debug.WriteLine("<<--- CompositionCompleted:{0} {1}", ev.IsCanceled, sw.ToString()); }
void EditContext_CompositionCompleted(CoreTextEditContext sender, CoreTextCompositionCompletedEventArgs args) { _lastResultText = _inputBuffer; _coreWindow.DispatcherQueue.TryEnqueue(() => { ReplaceText(new CoreTextRange { StartCaretPosition = 0, EndCaretPosition = _inputBuffer.Length }, string.Empty); }); if (!_timer.IsRunning) { _timer.Start(); } OnTextComposition(string.Empty, 0); _compositionStarted = false; }
void EditContext_CompositionCompleted(CoreTextEditContext sender, CoreTextCompositionCompletedEventArgs args) { }