fcitx / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
136 stars 15 forks source link

Using dead keys in preedit #54

Closed jansol closed 5 months ago

jansol commented 6 months ago

Summary

I am using a keyboard layout where ~ among other symbols are mapped to dead keys. I would like fcitx to pick up characters typed that way (e.g. dead key + space or dead key tapped twice) as part of the preedit string. Currently the characters get sent past fcitx, directly to the underlying application. The most common use for this would be converting ~ to 〜 which I do in this exact way on macOS, but haven't found a way to replicate it in fcitx yet. (I know I can type "nami" in mozc to get 〜 as a suggestion but the dead keys are much more convenient for me in this case)

wengxt commented 6 months ago

I can add composing support to mozc. At the same time, I'm just saying, maybe, you can set mozc to use a non-dead key layout if that works for you?

jansol commented 6 months ago

That works yes, just requires a little bit of muscle memory adjustment.

It would still be a nice feature to have, if only to reduce the number of surprises for people migrating from other platforms/input methods. The same feature request also applies at least to fcitx-rime, possibly others.

wengxt commented 6 months ago

@jansol add composing support from my point of view is like a per-engine effort, since the engine may prefer to handle the dead key directly with its own logic, or dead key string won't be easily to integrate into the engine logic (especially when engine maintains its own buffer that doesn't not accept random key/string).

jansol commented 6 months ago

Fair enough. Opened a separate issue for fcitx5-rime.

phoepsilonix commented 5 months ago

Before applying PR

Layout

English(us,alt. intl).

It will not be preedited, and only the dead key will be input.

English(us,intl., with dead keys).

It will not be preedited, and only the dead key will be input.

English(us,intl., with AltGr dead keys).

When tapping a dead key (+shift key), `(~) appears as a conversion candidate in preedit mode.

When PR is applied

Layout

English(us,alt. intl).

When tapping the dead key (+shift key) twice, `(~) is displayed as a conversion candidate in preedit mode.

English(us,intl., with dead keys).

When tapping the dead key (+shift key) twice, `(~) is displayed as a conversion candidate in preedit mode.

English(us,intl., with AltGr dead keys).

When tapping a dead key (+shift key), `(~) appears as a conversion candidate in preedit mode.

wengxt commented 5 months ago

@phoepsilonix hi I just wonder if you try to explain you find a bug in PR or what do you mean by this comment? :)

phoepsilonix commented 5 months ago

@wengxt Sorry for the lack of words. This is a report on the results of operation verification. I don't know what layout @jansol is using, but I think this is probably the expected behavior if SHIFT+dead key is assigned a tilde. However, even if we do not apply PR, depending on the layout we are using, even if a tilde is assigned to a dead key, it may be displayed as a conversion candidate.

wengxt commented 5 months ago

@phoepsilonix you probably think you’re pressing dead key while it’s not.

In dead altgr us layout, shift + “the key under esc”, is the normal ~. shift + altgr + that key is dead tilde.