Skip to content

Detect keyboard dismissal via window insets - #38

Merged
MisterGatto merged 1 commit into
skyprotocol:osp-masterfrom
HugeFrog24:ime-insets
Aug 5, 2026
Merged

Detect keyboard dismissal via window insets#38
MisterGatto merged 1 commit into
skyprotocol:osp-masterfrom
HugeFrog24:ime-insets

Conversation

@HugeFrog24

Copy link
Copy Markdown
Contributor

Follow-up to #37.

With gesture navigation there's no back key, so when you close the keyboard using its own hide button, nothing tells us it's gone. Tapping a text field after that just moved the cursor, and the keyboard never came back.

Android doesn't report that through key events at all. There's a report about exactly this (issue 242222756) that Google closed as working-as-intended, pointing at the ime() window inset as what you're meant to watch instead. So that's what this listens for.

One thing worth not deleting later: IME_FLAG_NO_FULLSCREEN. It looks like a cosmetic tweak, but it isn't. If the keyboard goes fullscreen, Android stops sending inset updates entirely, and since this activity is landscape-only that's exactly when it would happen. Without the flag the listener never fires at all.

Tested with gesture nav and floating Gboard, plus docked and floating keyboards in landscape.

@MisterGatto
MisterGatto merged commit 10da730 into skyprotocol:osp-master Aug 5, 2026
1 check failed
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.

2 participants