开发者

Android's InputMethodService keyEventCode won't work

I'm trying to create my keyboard, and now am at the place when the pressed button should send the letter to the application.

In the examples I found

InputMethodService.sendDownUpKeyEvents(keyEventCode);

But couldn't really figure out, what should go into keyEven开发者_运维百科tCode?

For example, how do I send a letter "A" ?

edit: Just one more thing, here ( http://developer.android.com/reference/android/view/KeyEvent.html ) I can find only codes for english character. How do I get other unicode characters?

Thanks!


That function takes the constants from the KeyEvent class. To send a, use

sendDownUpKeyEvents(KeyEvent.KEYCODE_A);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜