2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-30 14:10:11 +01:00

Try fix gamepad keys

This commit is contained in:
mittorn 2016-01-22 08:28:38 +00:00
parent eb1305dbd8
commit 28702daccc

View File

@ -1253,18 +1253,16 @@ View.OnKeyListener, View.OnTouchListener, SensorEventListener {
}
}*/
/* Handle all events as keyboard */
if( (event.getSource() & InputDevice.SOURCE_KEYBOARD) != 0) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
//Log.v("SDL", "key down: " + keyCode);
SDLActivity.onNativeKeyDown(keyCode);
return true;
}
else if (event.getAction() == KeyEvent.ACTION_UP) {
//Log.v("SDL", "key up: " + keyCode);
SDLActivity.onNativeKeyUp(keyCode);
return true;
}
}
if (event.getAction() == KeyEvent.ACTION_DOWN) {
//Log.v("SDL", "key down: " + keyCode);
SDLActivity.onNativeKeyDown(keyCode);
return true;
}
else if (event.getAction() == KeyEvent.ACTION_UP) {
//Log.v("SDL", "key up: " + keyCode);
SDLActivity.onNativeKeyUp(keyCode);
return true;
}
return false;
}