From da55d8672311bc09ccff35d4653c179f28fbc483 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Thu, 13 Dec 2018 20:49:08 +0200 Subject: [PATCH] SDL: account for rounded screen corners for text input --- project/java/MainActivity.java | 2 ++ project/jni/application/ballfield/ballfield.cpp | 4 ++-- todo.txt | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index 5279509e8..8aab7b017 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -871,6 +871,8 @@ public class MainActivity extends Activity screenKeyboard.setTextColor(this.getResources().getColor(android.R.color.background_light)); if( isRunningOnOUYA() && Globals.TvBorders ) screenKeyboard.setPadding(100, 100, 100, 100); // Bad bad HDMI TVs all have cropped borders + else + screenKeyboard.setPadding(20, 20, 20, 20); // Account for rounded screen corners _screenKeyboard = screenKeyboard; _videoLayout.addView(_screenKeyboard); //_screenKeyboard.setKeyListener(new TextKeyListener(TextKeyListener.Capitalize.NONE, false)); diff --git a/project/jni/application/ballfield/ballfield.cpp b/project/jni/application/ballfield/ballfield.cpp index 875fbc478..2a4c359c0 100644 --- a/project/jni/application/ballfield/ballfield.cpp +++ b/project/jni/application/ballfield/ballfield.cpp @@ -715,7 +715,7 @@ int main(int argc, char* argv[]) if(evt.key.keysym.sym == SDLK_2) { __android_log_print(ANDROID_LOG_INFO, "Ballfield", "Async text input started"); - asyncTextInputBuf[0] = 0; + strcpy(asyncTextInputBuf, "async"); SDL_ANDROID_GetScreenKeyboardTextInputAsync(asyncTextInputBuf, sizeof(asyncTextInputBuf)); } if(evt.key.keysym.sym == SDLK_3) @@ -768,7 +768,7 @@ int main(int argc, char* argv[]) } } } - if( screenKeyboardShown != SDL_IsScreenKeyboardShown(NULL)) + if( screenKeyboardShown != SDL_IsScreenKeyboardShown(NULL) ) { __android_log_print(ANDROID_LOG_INFO, "Ballfield", "Screen keyboard shown: %d -> %d", screenKeyboardShown, SDL_IsScreenKeyboardShown(NULL)); screenKeyboardShown = SDL_IsScreenKeyboardShown(NULL); diff --git a/todo.txt b/todo.txt index d5c07d8c6..d9b4196ae 100644 --- a/todo.txt +++ b/todo.txt @@ -27,8 +27,6 @@ TODO, which will get actually done - SDL: SdlVideoResizeKeepAspect=y mouse location shifted near right border. -- SDL: Text input window is slightly out of screen on phone with virtual navigation keys. - - SDL: Text input window still blocks touches sometimes after text input is finished. - Debian: proot crashes on Shield TV arm64 box.