Custom keyboard not working in fragment

こ雲淡風輕ζ 提交于 2019-12-06 00:29:16

Posting as an answer since I don't have the reputation to comment...

Check out the following documentation link. https://developer.android.com/reference/android/R.attr.html#keycode

The primaryCode parameter you are using as your switch input should be using these codes. (KeyEvent.KEYCODE_[0-9] correspond to 7-16)

Can you post your XML file please? My assumption is that your android:codes for each Key in there are corresponding to the KEYCODE_[0-9] for those.

If this is a correct assumption then your switch case 7 will be triggered by pressing key 0, case 8 by key 1, etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!