I have been looking into Gampad support (HID gamepads specifically) and have been having trouble with getting all the events to fire with Unity.
On the Java layer I’d expect the following functions to fire on the base activity.
-onKeyDown
-onKeyUp
-onGenericMotionEvent
This works great in a native android app however when I tweak our root activities to be something even as simple as and launch an app theonGenericMotionEvent function is never called. However if I leave the app and come back it then will fire as expected.
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
FLAPLog.err(FLAPUnityActivity.class, "OnGenericMotion:");
return true;
// TODO Auto-generated method stub
//return super.onGenericMotionEvent(event);
}
I cannot find a cause for this to work after resuming the app but not on a fresh launch was hoping anyone here would.