0

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?

Charles
  • 50,943
  • 13
  • 104
  • 142
David Given
  • 13,277
  • 9
  • 76
  • 123

1 Answers1

1

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.

Sujit
  • 10,512
  • 9
  • 40
  • 45
  • Sorry, last comment posted while rushed: plus, I want to get at the trackball events before they get converted to dpad events, because I need the analogue control. – David Given Sep 09 '11 at 13:03