Handle all key events as keyboard
This commit is contained in:
parent
f0275dcc92
commit
c2d7ae230c
1 changed files with 3 additions and 3 deletions
|
@ -1174,7 +1174,7 @@ View.OnKeyListener, View.OnTouchListener, SensorEventListener {
|
||||||
// Some SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD
|
// Some SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD
|
||||||
// So, we try to process them as DPAD or GAMEPAD events first, if that fails we try them as KEYBOARD
|
// So, we try to process them as DPAD or GAMEPAD events first, if that fails we try them as KEYBOARD
|
||||||
|
|
||||||
if ( (event.getSource() & InputDevice.SOURCE_GAMEPAD) != 0 ||
|
/*if ( (event.getSource() & InputDevice.SOURCE_GAMEPAD) != 0 ||
|
||||||
(event.getSource() & InputDevice.SOURCE_DPAD) != 0 ) {
|
(event.getSource() & InputDevice.SOURCE_DPAD) != 0 ) {
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
if (SDLActivity.onNativePadDown(event.getDeviceId(), keyCode) == 0) {
|
if (SDLActivity.onNativePadDown(event.getDeviceId(), keyCode) == 0) {
|
||||||
|
@ -1185,8 +1185,8 @@ View.OnKeyListener, View.OnTouchListener, SensorEventListener {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
/* Handle all events as keyboard */
|
||||||
if( (event.getSource() & InputDevice.SOURCE_KEYBOARD) != 0) {
|
if( (event.getSource() & InputDevice.SOURCE_KEYBOARD) != 0) {
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
//Log.v("SDL", "key down: " + keyCode);
|
//Log.v("SDL", "key down: " + keyCode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue