Skip to content
Permalink
Browse files

Android: fix/ignore L2/R2 buttons

L2/R2 will trigger a key press and an axis event if the trigger is pressed fully down
Was incorrectly ignoring L1/R1 key presses
  • Loading branch information...
zackhow committed Dec 14, 2018
1 parent 2dcd058 commit 0c0e045eda0b248d514c98f286ebe4f926bfb9d8
@@ -18,8 +18,7 @@ public static boolean shouldKeyBeIgnored(InputDevice inputDevice, int keyCode)
{
// The two analog triggers generate analog motion events as well as a keycode.
// We always prefer to use the analog values, so throw away the button press
// Even though the triggers are L/R2, without mappings they generate L/R1 events.
return keyCode == KeyEvent.KEYCODE_BUTTON_L1 || keyCode == KeyEvent.KEYCODE_BUTTON_R1;
return keyCode == KeyEvent.KEYCODE_BUTTON_L2 || keyCode == KeyEvent.KEYCODE_BUTTON_R2;
}
return false;
}

0 comments on commit 0c0e045

Please sign in to comment.
You can’t perform that action at this time.