Introducing OnTheSpot style of input methods
Richard Kimberly Heck
rikiheck at gmail.com
Mon Oct 28 17:30:55 UTC 2024
I know zero about this kind of thing, so won't have substantive
comments. But it looks like a very welcome improvement!
Riki
On 10/28/24 1:08 AM, Yokota K. wrote:
> Dear All,
>
> I wrote a code to introduce OnTheSpot style in the input method and would like to hear how you think.
>
> It relates mainly to CJK languages and translates phonetic inputs to the right written characters. Current LyX adopts OverTheSpot style so that typed phonetic inputs (preedits) overwrap on the main text. However, as input method editors become wiser and begins to accept longer phonetic inputs, OnTheSpot style is more preferred since preedits are inserted as if they are normal strings on screen and don’t hide the main text.
>
> The patch realises OnTheSpot style treating preedits as virtual elements in a row following the advice of Jean Marc (many thanks, Jean Marc!). The caret when preedit strings present is virtually shifted while the cursor stays at the original position. The virtual caret position is transmitted to the system input method so that conversion drop down appears in a correct position.
>
> Also, styles now more faithfully follow specification from the input method side, following the guide line of QInputMethodEvent class.
>
> The main code goes into new InputMethod and GuiInputMethod classes but there are some modifications in other classes, notably Row, TextMetrics and GuiWorkArea. Ui files are modified as well, but their change is basically to add ImHints properties to the text inputs. Other modifications in Ui files are automatically made by the editor of QtCreator.
>
> There is a little concern if I can safely remove a check around Line 1959 in Paragraph.cpp or relax the boundary around Line 762 in Row.cpp. They are changed since uncounted virtual preedit strings can push the character position beyond those boundaries.
>
> Advantage of the patch is, in addition to OnTheSpot style, on/off of the input method editor is automatically done when the user wants to issue emacs commands or goes into the math editor. I hope this greatly mitigates the input burden of users (e.g. Window users don’t have to push the cramping IM switch key Alt+` frequently!).
>
> If ImHints work properly, more elaborate control is possible but they don’t look so at this moment. It may be because input method editors don’t implement them or they work only on systems I haven’t tested. Only experimental code is in at this moment usable only in the debug mode.
>
> The patch is attached as a tar gzip file.
>
> Best regards,
>
> Koji Yokota
>
--
----------------------------
Richard Kimberly (Riki) Heck
Professor of Philosophy and Professor of Linguistics
Brown University
Pronouns: they/them/their
Website: http://rkheck.frege.org/
More information about the lyx-devel
mailing list