Checking Android input functionality
Joystick support is not implemented just yet, not difficult but it requires some work...
This commit is contained in:
parent
7c36237048
commit
1f1d8eeeeb
1 changed files with 7 additions and 1 deletions
|
@ -3079,7 +3079,8 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd)
|
||||||
// Android: Get input events
|
// Android: Get input events
|
||||||
static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
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);
|
int type = AInputEvent_getType(event);
|
||||||
|
|
||||||
|
@ -3092,6 +3093,11 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
||||||
// Get second touch position
|
// Get second touch position
|
||||||
touchPosition[1].x = AMotionEvent_getX(event, 1);
|
touchPosition[1].x = AMotionEvent_getX(event, 1);
|
||||||
touchPosition[1].y = AMotionEvent_getY(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)
|
else if (type == AINPUT_EVENT_TYPE_KEY)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue