Straight answer: as of that thread (posted within the last day), there's no confirmed fix yet — the B4A team's only advice so far is "don't target 36 until B4A ships SDK 36 support," and a third user just confirmed the same bug on a real Samsung device (not just the emulator). So nobody's posted a working code-level workaround publicly yet.
That said, here's the likely root cause and a workaround worth trying, since it fits the symptom pattern:
Likely cause: Android made
predictive back gesture mandatory-enabled for apps targeting API 36 (it was opt-in before). This replaces the old KeyEvent.KEYCODE_BACK dispatch mechanism with a new OnBackInvokedCallback/OnBackInvokedDispatcher API at the OS level — the back "key press" often never reaches dispatchKeyEvent/Activity_KeyPress anymore because the system intercepts it earlier as a gesture callback instead of a key event. This would explain why it specifically breaks on 36 and specifically breaks the back key.
Workaround to try — opt out of predictive back in the manifest:
SetApplicationAttribute(android:enableOnBackInvokedCallback, "false")
Add this as an application attribute in your Manifest editor. This tells Android to keep using the legacy key-event-based back handling instead of the new callback dispatcher, even while targeting API 36. This is Google's own documented escape hatch for apps not yet migrated, and it doesn't require lowering targetSdkVersion.
If that doesn't fully fix it (some report the opt-out itself gets ignored on newer OS versions per one user's experience that opting out of edge-to-edge enforcement didn't work when target sdk was 36), the more involved workaround is bypassing Activity_KeyPress entirely and hooking dispatchKeyEvent directly via a JavaObject/inline Java, or registering an OnBackInvokedCallback manually through reflection — but that's a real workaround, not a quick fix, and I don't have a tested B4A code snippet for it I can vouch for.
B4X
Given this is actively being tracked by Erel and is only ~1 day old as a reported issue on 36, I'd suggest posting your case in that same thread (or the RichardN one) — if the manifest opt-out above doesn't work for you, you'll likely get the real fix fastest straight from Erel once he responds.