Send arrow key in browser location bar on space swipe (#872)

location bar needs right arrow key to confirm URL suggestion
see also bugzilla.mozilla.org/show_bug.cgi?id=1999915

Co-authored-by: Rocka <i@rocka.me>
This commit is contained in:
Coelacanthus 2026-04-13 23:16:04 +08:00 committed by GitHub
parent da9980d79f
commit 630f9258dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -392,7 +392,12 @@ class FcitxInputMethodService : LifecycleInputMethodService() {
}
private fun handleArrowKey(keyCode: Int) {
if (currentInputEditorInfo.inputType and InputType.TYPE_MASK_CLASS == InputType.TYPE_NULL) {
val type = currentInputEditorInfo.inputType and InputType.TYPE_MASK_CLASS
val variation = currentInputEditorInfo.inputType and InputType.TYPE_MASK_VARIATION
if (type == InputType.TYPE_NULL ||
// confirm URL suggestion in browser location bar, see also https://bugzilla.mozilla.org/show_bug.cgi?id=1999915
type == InputType.TYPE_CLASS_TEXT && variation == InputType.TYPE_TEXT_VARIATION_URI
) {
sendDownUpKeyEvents(keyCode)
return
}