Hildon input framework and plugins

啧啧,真是复杂的玩意儿。
半夜没事就看看这个东西,想想怎么让n900上有中文输入。他们提到的一个日本人在做的基于him plugin机制,加上ibus输入法引擎做后端的东西,我也google到了。 http://domaemon.blogspot.com/ 访问需要翻墙。看起来人家好像进展不错?我其实是很希望人家赶紧做好,那ibus支持的输入法应该就都支持了,比如中文。。

其实我对n900的sdk也不是很熟。n810时,我都编译了直接在真机上跑,n900还没有真机。虽然him plugin example已经更新,但我编译安装了,完全不知道怎么启用能看看效果,这点也比较orz.
我现在两个思路,简单的就是看看能不能修正scim for mameo,让它跑起来。据说只是获取焦点的问题。我通过比较him framework的svn历史版本,大概也能找出些需要的相关代码。不过nokia其实不太厚道。这些东西都是内部开发的,开发完一次性merge到开源分支上,中间的逐次修改的记录就没有了。上面的那个日本人的blog里提及为什么不用scim,一个是说用him插件机制容易切换系统原有输入法和cjk输入法,这点其实我没看出来,虽然我确实认为这个蛮重要的,并且如果用scim的确基本就不可能了。他还说,因为浏览器不支持preedit就不能用scim,这点我表示怀疑。这个preedit我没理解错,就是inline input,那种输入英文字母,还没转成中文前的时候就先在输入框里显示,一般还带个下划线那种。但是scim是支持over-the-fly模式的,就是自己弹出个小框来做预输入区,中文字完全后再送入客户端文本框,所以我觉得这应该不是个问题。当然,能不能捕获到浏览器内部的输入框就是另外一个问题了,这好像在很多平台上都是比较麻烦的事情。

另外一个思路,就是我打算用最简单的方法改改him或framework。我目前都不能确定him和him framework两个项目间具体什么关系。但看到点的一些代码中的事件处理,我相信应该可以做如下处理:就是关着键盘时,什么都不改,该怎么用软键盘就怎么用,也就不能支持cjk输入;打开键盘时,原来继续要传给him plugin的全部拦截掉,自己送给一个输入法后端变成中文,直接上屏。我是觉得这样子代码入口会比较好定位,折腾plugin的话,除了本来就要做的和输入法引擎的联调外,还要做些ui,以及一大堆需要补全的接口。

当然,我还是只是想想而已。我在him及him framework的代码中都加了几行debug输出,编译安装,竟然都没有这些debug信息出来,让我很失望。。不知道是什么原因没能替换成功。再说了。。

About Evan

Comments

4 Responses to “Hildon input framework and plugins”
  1. X2 says:

    * It is true HIM & HIM framework does ugly work. (no svn log from N810 to N900).
    * HIM plugin system and framework side architecture design from beginning is not _well_ consider to be compatible with CJK. Currently, people only can make customized layouts. (if not introduce new framework)
    * HIM plugin example for N900 is a good improvement, check https://bugs.maemo.org/show_bug.cgi?id=4178
    * We are improving HIM plugin system atm. If it can move to open source, it will benefit to CJK a lot.
    * It is better to use HIM framework since browser engine has manipulated key events based on that. CJK needs pre-edit candidates, it is different from western “direct” input way.
    * If HIM default plugin can be open source, it will be fantastic, but I have no such power to decide.

    X2@Maemo, Nokia

    [Reply]

    Evan Reply:

    But I had tried the latest scim code in maemocjk project, it works.

    [Reply]

    X2 Reply:

    hmn…
    I didn’t try latest scim yet. Does it work in browser?

    [Reply]

    Evan Reply:

    Well, in fact, the latest update time of maemocjk scim code is last August.
    I did try it in the browser. I guess it cannot work there. But I believe there must be some way to fix that.
    HIM is just a middle level between gtk ime module and the real input method engine. SCIM implements both gtk ime module and input method engines.
    There’re still lots of things to do. Like the SCIM float window cannot be shown. I must disable the float window in SCIM settings. That’s because of when I click in a text input area, SCIM is actived, when it tries to show its float panel, the task switcher treats the new window as a new task, it will automatically switch to the new window. But then, the SCIM loses the focus area, it will close the float window.
    And scim-setup application’s shortcut is not in the application list.

    I posted a new blog article with a screen-shot of it.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!