Question about Input Events for external Joysticks and Keyboards when using NativeActivity
When my app gets the event callback from the NativeActivity class it then parses the AInputEvent object to see what type of input it has received.
With a little testing it seems that externally plugged in devices are given IDs starting at 4 and increasing ID numbers when the device is unplugged or re-plugged in.
Also my testing has determined that the buttons on the following devices map to the following keycodes:
/* PS2 controller has codes 188-199 */ /* X360 controller has codes 96-108 */
My issues are:
1. Is there a way to get a unique device ID of some sort so I can differentiate between the different Joystick types? Also so I can tell if the device is a joystick or a USB keyboard?
2. When one of the analog controls is pressed on the joysticks, it seems to trigger the event but the X & Y location in the event seems to always be for the left analog input and I am not sure how to read the values for the dpad, right-analog input or analog triggers.
Are these short-comings a limitation of the current NDK interface? If so, are these going to be fixed in the next release?
Just in-case it makes a difference, my only Android device I have, and what I am using for testing is a Nexus7