question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text input rework

See original GitHub issue

Unfortunately, we can’t just ask OS to give us a character alongside with a key press event. Most complex text input systems compose characters from multiple key presses and we shouldn’t try to interpret these key presses at all, because they are not intended by the user to be interpreted in application-specific way. So we need a way to indicate if a control expects text input at all or wants just raw key events. Our iOS/Android backends do that by checking if focused control is a TextBox.

Another problem is “preedit” or “marked” text. GTK app with preedit: preedit Winforms app without preedit no-preedit

See this video: https://vimeo.com/211472594

As you can see, input method interacts with text input area to display incomplete text sequences. This is done with XIM callbacks and NSTextInputClient (we partially implement NSTextInputClient to get text input at all).

That’s quite a lot of methods and it’s not quite possible to properly express them using routed events. Avalonia is built on the routed event model, so I propose to determine input handler (if any) by sending GetTextInputHandlerEventArgs and expect TextInputHandler property to be set if someone wants text input. Then everything text-related will be passed directly to said handler.

For now it will contain only one method, so we could solve at least the first problem and lay the foundation for text input system interaction

Old OnTextInput will be removed.

@AvaloniaUI/core

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
kekekekscommented, Nov 7, 2018

We could use some kind of a “virtual” text store that only contains preedit sequence (manipulated by XIM, TSF and Cocoa) and current cursor position (manipulated by our textbox). That will keep our public API more stable since the API surface will be smaller.

0reactions
robloocommented, Jul 17, 2021

[RDY] win32 ime #6223

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to update an input text with JavaScript?
All I want is that when I press the button, the text field gets a value updated to it. I tried using b.value="...
Read more >
Text Input Update Not Working - Power Platform Community
Hello,. I have a MS Powerapp customized form for this Hiring tool i built. It pulls from a MS List called "Onboarding Automation...
Read more >
Text input control in Power Apps
A box in which the user can type text, numbers, and other data. Description. The user can specify data by typing into a...
Read more >
Updating Text in JavaScript
In this article we will see how to update text in JavaScript. ... Adding a Text Input can update our text with whatever...
Read more >
Having text inputs updated based on another ...
Hi! I'm having trouble making something work. Basically I want to have multiple text input boxes, where modifying one will also update the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found