From 28518e229f8c42042ef623d42a0a82faf90ee4bb Mon Sep 17 00:00:00 2001 From: caspar Date: Mon, 12 Oct 2026 15:04:30 -0400 Subject: [PATCH] Allow the soft keyboard only on fields a person taps Every field keeps inputmode="none" and the forced hide. A finger tap (pointerdown, also through its label) gives that field the site's own inputmode back before Chromium focuses it, so numeric fields get a numeric keypad; it is suppressed again on blur or a cancelled tap, so scans and programmatic focus never open the keyboard. Native code checks the focused field before hiding the keyboard. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 15 +- .../java/mx/joykoo/scanner/KeyboardPolicy.kt | 136 ++++++++++++++++++ .../java/mx/joykoo/scanner/MainActivity.kt | 63 +++----- .../joykoo/scanner/NoSoftKeyboardWebView.kt | 18 ++- 4 files changed, 175 insertions(+), 57 deletions(-) create mode 100644 app/src/main/java/mx/joykoo/scanner/KeyboardPolicy.kt diff --git a/CLAUDE.md b/CLAUDE.md index d2a2c02..e955b20 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,23 +6,30 @@ Native Android app (Kotlin) that wraps `https://smart.joykoo.mx/` in a fullscree ## Critical Design Decision -The Android soft keyboard must NEVER appear. Keyboard suppression uses multiple layers — do not remove any of them: +The Android soft keyboard must NEVER appear for scanner fields. The only exception is a field a person taps with a finger (see Keyboard Policy below). Keyboard suppression uses multiple layers — do not remove any of them: 1. `NoSoftKeyboardWebView.onCheckIsTextEditor()` → `false` 2. `EditorInfo` flags `IME_FLAG_NO_EXTRACT_UI | IME_FLAG_NO_FULLSCREEN` in `onCreateInputConnection()` -3. `InputMethodManager.hideSoftInputFromWindow()` posted after each InputConnection request and on page load / window focus -4. JavaScript injection setting `inputmode="none"` on all ``, `