Commit KEYCODE_SPACE as text input on Android

This commit is contained in:
Cole Campbell 2016-07-04 10:39:32 -04:00
parent b7e45f8a1a
commit 8f17b20388

View File

@ -1439,7 +1439,7 @@ class DummyEdit extends View implements View.OnKeyListener {
public boolean onKey(View v, int keyCode, KeyEvent event) {
// This handles the hardware keyboard input
if (event.isPrintingKey()) {
if (event.isPrintingKey() || keyCode == KeyEvent.KEYCODE_SPACE) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
}
@ -1502,7 +1502,7 @@ class SDLInputConnection extends BaseInputConnection {
*/
int keyCode = event.getKeyCode();
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (event.isPrintingKey()) {
if (event.isPrintingKey() || keyCode == KeyEvent.KEYCODE_SPACE) {
commitText(String.valueOf((char) event.getUnicodeChar()), 1);
}
SDLActivity.onNativeKeyDown(keyCode);