From 4b23724639c6641fe0d3c8e64375861610ac13b2 Mon Sep 17 00:00:00 2001 From: caspar Date: Mon, 12 Oct 2026 15:02:45 -0400 Subject: [PATCH] Allow the soft keyboard on fields the site marks as typed Scan fields keep inputmode="none" and the forced hide; fields the site's markup marks as manual (data-jk, its own inputmode, textarea, autocapitalize, or a typing input type) keep the keyboard and the site's inputmode, so numeric fields get a numeric keypad. Native code checks the focused field before hiding the keyboard. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 21 +++- .../java/mx/joykoo/scanner/KeyboardPolicy.kt | 102 ++++++++++++++++++ .../java/mx/joykoo/scanner/MainActivity.kt | 63 +++-------- .../joykoo/scanner/NoSoftKeyboardWebView.kt | 18 ++-- 4 files changed, 147 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..f579fa1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,23 +6,36 @@ 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. Fields that the site's markup marks as typed by a person are the only exception (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 ``, `