Receive keyboard events for any language in Android
I am making an application for Android 3.1, which intercepts keyboard events and sends them to my server (Windows).
Problem: My application (activity) is able to receive events for English characters, but when keyboard is other than English, keyup and keydown events are not reaching my application.
Code snippet for launching keyboard:
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputMgr.toggleSoftInput(0, 0);
Overloaded following functions:
public boolean onKeyDown(int keyCode, KeyEvent event)
public boolean onKeyUp(int keyCode, KeyEvent event)
Is there anything I am missing? My main objective is to receive events for any keyboard (ie any language)
Thanks,
链接地址: http://www.djcxy.com/p/18428.html上一篇: 倾听键盘事件而不捕获它们?
下一篇: 接收Android中任何语言的键盘事件