|
@@ -231,6 +231,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|
|
protected static boolean mSDLMainFinished = false;
|
|
|
protected static boolean mActivityCreated = false;
|
|
|
private static SDLFileDialogState mFileDialogState = null;
|
|
|
+ protected static boolean mDispatchingKeyEvent = false;
|
|
|
|
|
|
protected static SDLGenericMotionListener_API14 getMotionListener() {
|
|
|
if (mMotionListener == null) {
|
|
@@ -807,7 +808,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|
|
) {
|
|
|
return false;
|
|
|
}
|
|
|
- return super.dispatchKeyEvent(event);
|
|
|
+ mDispatchingKeyEvent = true;
|
|
|
+ boolean result = super.dispatchKeyEvent(event);
|
|
|
+ mDispatchingKeyEvent = false;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static boolean dispatchingKeyEvent() {
|
|
|
+ return mDispatchingKeyEvent;
|
|
|
}
|
|
|
|
|
|
/* Transition to next state */
|
|
@@ -1507,6 +1515,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|
|
}
|
|
|
|
|
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
|
|
+ onNativeKeyDown(keyCode);
|
|
|
+
|
|
|
if (isTextInputEvent(event)) {
|
|
|
if (ic != null) {
|
|
|
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
|
@@ -1514,7 +1524,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|
|
SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
|
|
}
|
|
|
}
|
|
|
- onNativeKeyDown(keyCode);
|
|
|
return true;
|
|
|
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
|
|
onNativeKeyUp(keyCode);
|