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);
精彩评论