Skip to content
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

Demo input method #12

Open
Ferada opened this issue Mar 22, 2021 · 8 comments
Open

Demo input method #12

Ferada opened this issue Mar 22, 2021 · 8 comments

Comments

@Ferada
Copy link

Ferada commented Mar 22, 2021

I'm interested in using this, but it was a little bit difficult to find any information on how to. Would it be possible to add a simple demo input method that shows how to use this API, including how to make sure it gets loaded from the user configuration?

Also, there's also a Lua module for fcitx 4, but that doesn't seem have the same API available yet, so it's not possible to add a full input method via Lua in 4, is that correct?

@wengxt
Copy link
Member

wengxt commented Mar 23, 2021

Right now it's not possible to implement input method with this because of missing API (mainly because there's no such requirements).

But if you have such requirement I can add one.

Can you provide more information about what do you want to implement?

@Ferada
Copy link
Author

Ferada commented Mar 23, 2021

I was considering Lua just to speed things up for development, I'm looking into presage integration for one.

Other specific ideas were basically turning Quick Phrase into a "postfix" IME, so typing the abbreviation first, then selecting the possible expansion, similar to how Vim's abbreviations work.

@wengxt
Copy link
Member

wengxt commented Mar 23, 2021

As for presage, you'd better for extending https://github.com/fcitx/fcitx5/tree/master/src/modules/spell instead, so it can benefit everything that using it in general. In fcitx 4 we used to have presage support in its spell module but I have a feeling that it is not actively maintained any more so I didn't port it to fcitx 5.

As for the second one, if it's generally useful, you'd better look into to see if it's a better place to implement it. https://github.com/fcitx/fcitx5/tree/master/src/im/keyboard.

Adding a new engine that have duplicate functionality is not really a thing we'd like to see.

quickphrase itself is extendable with fcitx5-lua. Here's an example for it:
https://fcitx.github.io/fcitx5-lua/modules/fcitx.html

https://github.com/fcitx/fcitx5-chinese-addons/blob/master/im/pinyin/pinyin.lua

@Ferada
Copy link
Author

Ferada commented Mar 23, 2021

That's very helpful information, thank you.

Adding a new engine that have duplicate functionality is not really a thing we'd like to see.

I can imagine. Let me ask this then: Can you see any way where the quickphrase functionality could be triggered later, that is, after already writing the corresponding phrase? To me that's mostly a question of ergonomics, e.g. the way the pinyin input works is just a much better approach and I'd like to have the same for quickphrase. The way I understood it so far this would require keeping part of the current text in the IME and only releasing it to the application if it's clear that no replacement was selected?

@wengxt
Copy link
Member

wengxt commented Mar 23, 2021

I realize you probably aren't aware that fcitx's keyboard engine also provides a predication mode?
Just press Ctrl + Alt + H to enable it.

Right now it has both spell checking and emoji in the completion result.

Here's a screen shot for it from fcitx's wiki
keyboard engine from fcitx 4

Is that the thing you want to implement?

The underlined text is just a place holder that input method asked application to display (usually refered as "Preedit").

When I'm talking about duplication, I just try to say certain feature should be done without implementation a whole new engine to do so. Sometimes it might be better to implement it as a special mode within certain engine.

@Ferada
Copy link
Author

Ferada commented Mar 23, 2021

Makes sense, I'll see if I can make some modifications for myself to that part instead then. Thanks for the information, much appreciated.

@Ferada Ferada closed this as completed Mar 23, 2021
@wengxt
Copy link
Member

wengxt commented Mar 23, 2021

Feel free to join telegram https://fcitx-im.org/telegram/captcha.html / irc fcitx@freenode for discussion

@wengxt wengxt reopened this Apr 6, 2021
@wengxt
Copy link
Member

wengxt commented Apr 6, 2021

Still, adding support for lua based input method is also a desired feature. Keep this open for tracking that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants