Add an extra check to prevent 2.3 controller handling error

This commit is contained in:
TwistedUmbrella 2014-01-24 16:15:44 -05:00
parent 4175e3e813
commit 17f4a77e92
1 changed files with 20 additions and 16 deletions

View File

@ -437,6 +437,7 @@ public class GL2JNIActivity extends Activity {
*/ */
boolean handle_key(Integer playerNum, int kc, boolean down) { boolean handle_key(Integer playerNum, int kc, boolean down) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
if (playerNum == null) if (playerNum == null)
return false; return false;
@ -460,6 +461,9 @@ public class GL2JNIActivity extends Activity {
} else { } else {
return true; return true;
} }
} else {
return false;
}
} }
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {