Android应用程序特定的软键盘应用程序、键盘、Android

由网友(无匹配)分享简介:有没有一种方法来创建一个应用程序特定的软键盘在Android?阅读InputMethodService文档,并检查了替代键盘的应用服务在那里后,我想,备用键盘只能进行系统的广泛应用进行配置(通过设置 - >区域设置和文本)。Is there a way to create an app specific soft k...

有没有一种方法来创建一个应用程序特定的软键盘在Android?阅读InputMethodService文档,并检查了替代键盘的应用服务在那里后,我想,备用键盘只能进行系统的广泛应用进行配置(通过设置 - >区域设置和文本)。

Is there a way to create an app specific soft keyboard on Android? After reading about InputMethodService docs and checking out alternative keyboard apps out there, I figure the alternate keyboard can only be configured for system wide usage (through Settings -> Locale and Text).

如果回答上面的问题是否定的,那么有没有至少一种方式来加载自定义词典,并覆盖系统键盘的默认词典(只有当我的应用程序正在使用)?这将帮助时,他只挖几个键的用户带来非常相关的建议。

If the answer to above question is no, then is there at least a way to load a custom dictionary and override the default dictionary of the system keyboard (only when my app is in use)? That will help in giving very relevant suggestions to the user when he has only tapped couple of keys.

推荐答案

如果你只是想要一个视图,看起来就像一个软键盘,我这样做,在我SmallKeyboard类。你只需要延长 android.inputmethodservice.KeyboardView 并决定布局。看到onKey和onText方法在该文件中,当密钥是pressed所采取的行动的末端。

If you just want a View that looks and acts like a soft keyboard, I did that in my SmallKeyboard class. You just need to extend android.inputmethodservice.KeyboardView and decide on layout. See the onKey and onText methods at the end of that file for the action taken when keys are pressed.

相反,我的键盘模型内部类中,你可以从XML 如果您的键设置是相当恒定的。

Instead of my keyboard model inner class, you could load it from XML if your key set is fairly constant.

阅读全文

相关推荐

最新文章