Skip to content

Commit

Permalink
[Android] Improve gamepad things - at least for Xbox pads
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Feb 1, 2022
1 parent 7d1341c commit 13661eb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Backends/System/Android/Sources/kinc/backend/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace {
float y = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_Y, 0);
// int id = AInputEvent_getDeviceId(event);
kinc_internal_gamepad_trigger_axis(0, 0, x);
kinc_internal_gamepad_trigger_axis(0, 1, y);
kinc_internal_gamepad_trigger_axis(0, 1, -y);
return 1;
}
}
Expand Down Expand Up @@ -263,7 +263,7 @@ namespace {
return 1;
case AKEYCODE_DPAD_CENTER:
case AKEYCODE_BUTTON_B:
kinc_internal_gamepad_trigger_button(0, 0, 1);
kinc_internal_gamepad_trigger_button(0, 1, 1);
return 1;
case AKEYCODE_BACK:
if (AKeyEvent_getMetaState(event) & AMETA_ALT_ON) { // Xperia Play
Expand All @@ -275,13 +275,13 @@ namespace {
return 1;
}
case AKEYCODE_BUTTON_A:
kinc_internal_gamepad_trigger_button(0, 1, 1);
kinc_internal_gamepad_trigger_button(0, 0, 1);
return 1;
case AKEYCODE_BUTTON_Y:
kinc_internal_gamepad_trigger_button(0, 2, 1);
kinc_internal_gamepad_trigger_button(0, 3, 1);
return 1;
case AKEYCODE_BUTTON_X:
kinc_internal_gamepad_trigger_button(0, 3, 1);
kinc_internal_gamepad_trigger_button(0, 2, 1);
return 1;
case AKEYCODE_BUTTON_L1:
kinc_internal_gamepad_trigger_button(0, 4, 1);
Expand Down Expand Up @@ -510,7 +510,7 @@ namespace {
return 1;
case AKEYCODE_DPAD_CENTER:
case AKEYCODE_BUTTON_B:
kinc_internal_gamepad_trigger_button(0, 0, 0);
kinc_internal_gamepad_trigger_button(0, 1, 0);
return 1;
case AKEYCODE_BACK:
if (AKeyEvent_getMetaState(event) & AMETA_ALT_ON) { // Xperia Play
Expand All @@ -522,13 +522,13 @@ namespace {
return 1;
}
case AKEYCODE_BUTTON_A:
kinc_internal_gamepad_trigger_button(0, 1, 0);
kinc_internal_gamepad_trigger_button(0, 0, 0);
return 1;
case AKEYCODE_BUTTON_Y:
kinc_internal_gamepad_trigger_button(0, 2, 0);
kinc_internal_gamepad_trigger_button(0, 3, 0);
return 1;
case AKEYCODE_BUTTON_X:
kinc_internal_gamepad_trigger_button(0, 3, 0);
kinc_internal_gamepad_trigger_button(0, 2, 0);
return 1;
case AKEYCODE_BUTTON_L1:
kinc_internal_gamepad_trigger_button(0, 4, 0);
Expand Down

0 comments on commit 13661eb

Please sign in to comment.