Checking Android input functionality

Joystick support is not implemented just yet, not difficult but it
requires some work...
This commit is contained in:
raysan5 2018-07-05 19:00:49 +02:00
parent 7c36237048
commit 1f1d8eeeeb
1 changed files with 7 additions and 1 deletions

View File

@ -3079,7 +3079,8 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd)
// Android: Get input events
static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
{
//http://developer.android.com/ndk/reference/index.html
// If additional inputs are required check:
// https://developer.android.com/ndk/reference/group/input
int type = AInputEvent_getType(event);
@ -3092,6 +3093,11 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
// Get second touch position
touchPosition[1].x = AMotionEvent_getX(event, 1);
touchPosition[1].y = AMotionEvent_getY(event, 1);
// Useful functions for gamepad inputs:
//AMotionEvent_getAction()
//AMotionEvent_getAxisValue()
//AMotionEvent_getButtonState()
}
else if (type == AINPUT_EVENT_TYPE_KEY)
{