Receiving trackball events with an Android NativeActivity
I have a NativeActivity-based application that wants to receive trackball events.
According to the (sketchy) documentation, I should be receiving these via the struct android_app
's onInputEvent()
callback, the same as I do for key and motion events. However, I'm not getting any. Looking at the tracing the event gets sent to the glue layer but is apparently consumed by the call to AInputQueue_preDispatchEvent()
in process_input()
, and so never gets delivered to my application.
Has anyone gotten trackball events working with NativeActivity, and if so开发者_开发百科, how?
you can override onKeyDown() and use KEYCODE_DPAD_DOWN,KEYCODE_DPAD_LEFT,KEYCODE_DPAD_RIGHT,KEYCODE_DPAD_UP to handle all event . I was using it for a game on HTC desire device.
精彩评论