From 8f17b20388fb5fe579eac1467b67e97e124bc39a Mon Sep 17 00:00:00 2001 From: Cole Campbell Date: Mon, 4 Jul 2016 10:39:32 -0400 Subject: [PATCH] Commit KEYCODE_SPACE as text input on Android --- android-project/src/org/libsdl/app/SDLActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java index 989abb560..7e300733e 100644 --- a/android-project/src/org/libsdl/app/SDLActivity.java +++ b/android-project/src/org/libsdl/app/SDLActivity.java @@ -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);