this lets you manually define which control handlers are tried first, for debugging, curiosity, and also usability on some "special case" devices (until auto detection is a thing)
- the prompt only shows once so users can use fake dpad if they wish
- optimized fallback by checking if ime is actually connected before using ime dpad. this saves a (noticeable) few hundred milliseconds when the ime is misbehaving.
there may be remaining edge cases, but hopefully this should work in the majority of scenarios.
I've tested and verified:
- single/long press with no ime on native buttons
- single/long press with ime on native buttons
- single/long press with ime on native buttons with broken focus (requiring fallback)
- single/long press with ime on non-native buttons
- single/long press with ime within games
- single press with no ime on fake focus
- single press with ime on fake focus
- single press with ime on system prompts (requiring fallback)
the select button can now use tryImeDpad(), which fixes some system prompts and avoids the issue where selecting the first option in a settings dialog doesn't work until you move the dpad.
this also fixes the google account sign in page, as it's able to detect the movements there now.
the downside is that the events seem to take forever (100-300 ms) to fire. this means there's now a considerable delay before the fallback is used. It's probably not a big deal since most daily usage won't require the fallback at all anyway.
the only real bug left (that I know of): when ime dpad is used but fake dpad fake focus is active, there is both a real and fake focus at the same time, and they (usually) don't agree. this is not as simple as turning off fake dpad focus when ime dpad is active since that would make the ime input switcher inaccessible (as the ime dpad cannot navigate the ime switcher)
the only navigation button the ime service can do is the back button, but it still makes it infinitely more useful if the accessibility service isn't enabled.
I want to replace the error message definitions with callbacks to allow for more flexibility, especially with this error, as the complexity of knowing which permissions are needed and why grows.
sadly this negates some of the performance benefits, but this seems to have fixed the problem where some menus lose the ability to be navigated with the ime.
the funny thing is it's not relying on fakeDpad() to fix that, but the side effect of changing the input focus. after that, the ime dpad magically works again.
- keyboard input (untested)
- volume input (seems to work less reliably than the accessibility version)
- media input (works more reliably than media session api, but won't support media sessions)
- support separate key down and key up events
- remove the destroy() callback that's only used for one implementation
- refactor event handlers
- improve callback selection for KeyboardInput
- for api 30, 31, and 32
- uses ime input for dpad
- when ime summoned, it switches to the previously set keyboard\
- fakeDpad() is used to navigate the on-screen/software keyboard
- when keyboard is closed and dpad is needed again, the accessibility service switches the keyboard back
it may be possible to implement a variation of this on older api levels using secure settings
- add keyboard settings and ime switcher buttons
- refactor activity launching
- move text box
- move start server button to top
- move debug text to bottom
- delete try bind (unused)
- update labels
replaces the jank that I was using previously to bind the accessibility input service, as the accessibility service doesn't support regular binders.
there are more services like that coming, so I saw it fit to centralize the jank in one location instead of having it all over the place.