From a7b79022e5a81bc15b1865bfb40f5922b52c5244 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 16 Jun 2024 20:05:31 +0200 Subject: [PATCH] Launcher activity: Don't consume events in text field Allow the keybindings to have an effect in the "Try here" text field. --- srcs/juloo.keyboard2/LauncherActivity.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/srcs/juloo.keyboard2/LauncherActivity.java b/srcs/juloo.keyboard2/LauncherActivity.java index 7063d93..2ca241a 100644 --- a/srcs/juloo.keyboard2/LauncherActivity.java +++ b/srcs/juloo.keyboard2/LauncherActivity.java @@ -28,7 +28,6 @@ public class LauncherActivity extends Activity @Override public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); setContentView(R.layout.launcher_activity); _intro_video = (VideoView)findViewById(R.id.launcher_intro_video); @@ -39,21 +38,26 @@ public class LauncherActivity extends Activity this.new Tryhere_OnUnhandledKeyEventListener()); setup_intro_video(_intro_video); } + @Override - public final boolean onCreateOptionsMenu(Menu menu) { + public final boolean onCreateOptionsMenu(Menu menu) + { getMenuInflater().inflate(R.menu.launcher_menu, menu); return true; } @Override - public final boolean onOptionsItemSelected(MenuItem item) { - if (item.getItemId() == R.id.btnLaunchSettingsActivity) { + public final boolean onOptionsItemSelected(MenuItem item) + { + if (item.getItemId() == R.id.btnLaunchSettingsActivity) + { Intent intent = new Intent(LauncherActivity.this, SettingsActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } return super.onOptionsItemSelected(item); } + public void launch_imesettings(View _btn) { startActivity(new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS)); @@ -113,7 +117,7 @@ public class LauncherActivity extends Activity String kc = KeyEvent.keyCodeToString(ev.getKeyCode()); s.append(kc.replaceFirst("^KEYCODE_", "")); _tryhere_text.setText(s.toString()); - return true; + return false; } } }