Skip to content

編集・修飾キーを追加 / Add editing and modifier keys - #1225

Open
KazumaProject wants to merge 1 commit into
devfrom
codex/special-key-actions
Open

KazumaProject wants to merge 1 commit into
devfrom
codex/special-key-actions

Conversation

@KazumaProject

Copy link
Copy Markdown
Owner

概要

  • カスタムキーボードとスミレ入力の特殊キーに、Tab、Esc、Home、End、ページ移動、選択範囲の左右への拡張、入力欄の次/前、削除取り消しを追加します。選択操作は既存の SelectLeft / SelectRight を使用します。
  • Ctrl と Alt はタップごとにロック/解除し、ロック状態をアイコンに表示します。入力欄の切り替えやキーボードを閉じたときは状態を解除します。対応する英数字・記号の一文字と一部の特殊キーを修飾キー付きイベントとして送り、対応付けられない入力は通常どおり入力します。
  • 未確定入力中は追加した移動・選択と修飾キー付きショートカットを実行せず、変換中の Esc は読みへ戻します。削除取り消しが設定されている場合、通常の削除キーでは入力欄で実際に削除されたことを確認できたテキストを記録します。

入力欄移動の制約

入力欄が EditorInfo で通知した次/前のアクションのみを要求します。IME は Tab、Shift+Tab、Enter による代替を送りません。要求後にフォーカスが移動するかは入力欄の実装に依存します。Android 35 の標準 EditText では、IME オプション未指定でも前の入力欄を通知する一方、前への要求を入力欄自身が Enter に変換するケースをエミュレーターで確認しました。

削除結果を取得または確認できない入力欄では、削除は送りますが取り消し履歴を作成しません。Ctrl/Alt を付けた削除キーもショートカットとして送るため、この履歴には記録しません。

検証

  • カスタムキーボードの単体テスト 285 件、およびキーの対応付け・保存、選択移動、削除履歴に関するアプリ単体テスト 37 件。
  • Android 35 エミュレーターの IME と入力欄を使い、カスタムキーボードおよびスミレ入力の特殊キー、入力欄移動、未確定入力、削除取り消しを検証。
  • スミレ入力の特殊キー編集画面の保存・再読込・初期化を検証。実機では未確認。

Summary

  • Add Tab, Esc, Home, End, page navigation, selection extension, next/previous field, and undo deletion to the custom keyboard and Sumire special-key editors. Selection uses the existing SelectLeft and SelectRight actions.
  • Toggle Ctrl and Alt locks on each tap and show their locked icons. Clear the locks when the input field changes or the keyboard closes. Supported single alphanumeric/punctuation characters and special keys are sent as modified key events; unmappable text follows the normal input path.
  • Suppress the new navigation, selection, and modified shortcuts during preedit; Esc returns an active conversion to its reading. When undo deletion is configured, record text from the ordinary delete key only after the editor confirms its removal.

Field navigation limitations

Only actions advertised by the current EditorInfo are requested. The IME does not send Tab, Shift+Tab, or Enter as a fallback. Whether focus moves depends on the editor. On an Android 35 emulator, a standard EditText without explicit IME options advertised previous-field navigation but its own implementation converted the previous action into Enter.

If the editor cannot provide or confirm the deletion result, the deletion is sent but no undo history is created. Ctrl/Alt-modified delete is sent as a shortcut and is not added to this history.

Validation

  • 285 custom keyboard unit tests and 37 targeted app tests for key mapping and persistence, selection movement, and deletion history.
  • Android 35 emulator tests using the actual IME and editors for custom keyboard and Sumire actions, field navigation, preedit, and deletion undo.
  • Sumire special-key editor save, reload, and reset test. Physical devices were not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant