Skip to content

カスタムキーボードの長押し終了処理を修正 / Fix custom keyboard long-press release handling - #1366

Merged
KazumaProject merged 3 commits into
devfrom
codex/fix-custom-delete-repeat
Nov 18, 2026
Merged

KazumaProject merged 3 commits into
devfrom
codex/fix-custom-delete-repeat

Conversation

@KazumaProject

@KazumaProject KazumaProject commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

日本語

削除キーを長押ししてから上・右にフリックすると、指を離した方向のアクションで長押し終了を処理していました。空欄に見える「何もしない」や空文字の割り当てでは、開始済みの削除リピートが止まらず、その後に入力した文字も削除されることがありました。

フリック先のアクションが変わった時点で、直前に開始した長押しをキャンセルします。タッチのキャンセルやコントローラーの破棄でも、開始済みのアクションへキャンセルを通知します。

カスタムキーボード間の切り替えが長押し後に反応しない報告も修正しました。単押しの特殊キーは長押し判定後に通常のアクションを実行せず、指を離しても切り替わりませんでした。カスタムレイアウトの特殊キーで1回の操作を行うものは、指を離した時点で通常のアクションを実行します。この処理は単押しとフリックの両方に適用します。削除リピートやカーソルの連続移動などには専用の長押し処理を使います。

「空のフレキシブルレイアウト」を使った Robolectric の回帰テストで、上・右それぞれについて、割り当てなし、「何もしない」、空文字、操作の割り当てありの各ケースを検証しました。削除のキャンセル通知、指を離したときのアクション、その直後の QWERTY キー a の入力通知を確認しました。./gradlew --offline :custom_keyboard:testDebugUnitTest は352件すべて通過しました。

アプリ側では、長押しを離すと指定のカスタムキーボードが選択されること、キーの外へドラッグして単押しをキャンセルできること、フリック先の絵文字キーが離したときに1回動作すること、削除のリピートが離したときに止まることを確認しました。Android Lite 版の関連テスト38件が通過しました。

English

The controller handled the end of a long press using the action selected at key-up. An explicit no-op or empty text mapping could leave an already running backspace repeat active, allowing it to delete later input.

The controller now cancels the active long-press action when the selected action changes. Touch cancellation and controller disposal also cancel the active action.

The separate keyboard-switch report came from the long-press path skipping the regular action on a single-action key. Custom special keys that perform a one-shot action now execute the regular action once on release, including actions assigned to flick directions. Backspace repeat and other dedicated hold actions use their existing long-press handlers.

A Robolectric regression test uses the Empty 5x4 Flexible Layout with a delete key and a QWERTY a key. It covers up and right flicks with no mapping, a no-op, empty text, and an assigned action. It checks delete cancellation, the release action, and the following a input callback. All 352 tests passed with ./gradlew --offline :custom_keyboard:testDebugUnitTest.

Robolectric tests exercise the IME listener and verify selecting the destination custom keyboard on release, canceling by dragging off a single-action key, opening the emoji keyboard once after a held flick, and stopping backspace repeat on release. All 38 selected Lite app tests passed.

@KazumaProject KazumaProject changed the title カスタムキーボードの削除リピート停止を修正 / Fix stuck delete repeat on custom keyboards カスタムキーボードの長押し終了処理を修正 / Fix custom keyboard long-press release handling Nov 17, 2026
@KazumaProject
KazumaProject merged commit d63cd62 into dev Nov 18, 2026
1 check passed
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