Roger
Roger

Reputation: 6527

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 keyEventCode?

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!

Upvotes: 0

Views: 560

Answers (1)

user658042
user658042

Reputation:

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

sendDownUpKeyEvents(KeyEvent.KEYCODE_A);

Upvotes: 1

Related Questions