android ndk multitouch?

让人想犯罪 __ 提交于 2019-12-04 08:19:21

问题


im writing an application that uses only native code.
So is it possible to get multitouch events in ndk?
I feel like ive serched the whole web, but without finding anything!

Does anyone know how to do this?


回答1:


Yes, it is. You can check example called native-activity to see how to get input events. Look for engine_handle_input function. AInputEvent_getType function returns type of event. If it is AINPUT_EVENT_TYPE_MOTION then using AKeyEvent_getAction function you can get different information about touch event. Use the AMOTION_EVENT_ACTION_MASK, AMOTION_EVENT_ACTION_POINTER_INDEX_MASK, AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP enums in same way you use them in Java API: http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html



来源:https://stackoverflow.com/questions/12500825/android-ndk-multitouch

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