100 Commits
Author SHA1 Message Date
Benjamin Wiegand 27dc4c4dfa version 0.0.2 2025-07-15 12:48:02 -07:00
Benjamin Wiegand 2a626d5b61 implement power button 2025-07-15 12:17:49 -07:00
Benjamin Wiegand f90b1852f7 remove lint suppression 2025-07-15 08:40:19 -07:00
Benjamin Wiegand 4d3b0a29e5 update input method preferences without requiring app restart 2025-07-15 08:31:12 -07:00
Benjamin Wiegand fde3c94576 don't use FLAG_ACTIVITY_MULTIPLE_TASK 2025-07-15 08:08:27 -07:00
Benjamin Wiegand 1f8721ceea fix missing string 2025-07-15 07:51:11 -07:00
Benjamin Wiegand 578c9b0352 make input control handler priority configurable
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)
2025-07-15 07:17:52 -07:00
Benjamin Wiegand e173fb546f add notification listener permission rationale 2025-07-15 07:10:54 -07:00
Benjamin Wiegand 74816e7d97 add preference screen 2025-07-12 13:28:49 -07:00
Benjamin Wiegand 9b335d8563 fix application-level banner 2025-07-11 12:00:27 -07:00
Benjamin Wiegand 8fb23947e2 version 0.0.1 2025-07-10 16:55:06 -07:00
Benjamin Wiegand 39d6776bc4 use correct icon on gtv and non-tv 2025-07-10 16:16:55 -07:00
Benjamin Wiegand 34e8cdc194 add new launcher icon 2025-07-10 16:11:01 -07:00
Benjamin Wiegand 40021ed7c8 add banner icon for leanback 2025-07-10 15:56:45 -07:00
Benjamin Wiegand 8a6f5707f9 get correct permission request spec for ime 2025-07-10 14:49:47 -07:00
Benjamin Wiegand b865eee47f add package name to overlay settings intent 2025-07-10 14:49:24 -07:00
Benjamin Wiegand 1c8d219e07 add more permission request dialogs 2025-07-10 12:13:55 -07:00
Benjamin Wiegand c7fdfc5a3a add error message for application overlay permission 2025-07-09 20:28:52 -07:00
Benjamin Wiegand 8368bc42f2 use app context for test pairing dialog 2025-07-09 20:05:13 -07:00
Benjamin Wiegand ba7cfe0ca4 highlight cancel button by default 2025-07-09 20:03:38 -07:00
Benjamin Wiegand ce202f476b always run show() and hide() on ui thread 2025-07-09 20:03:04 -07:00
Benjamin Wiegand 6cb1060200 make pairing dialog an application overlay 2025-07-09 20:01:47 -07:00
Benjamin Wiegand 9146d50e42 update keyboard window on keyboard switch 2025-07-07 00:50:30 -07:00
Benjamin Wiegand e039b49e1c debug button for overlay settings 2025-07-06 22:44:33 -07:00
Benjamin Wiegand acd7148569 show prompt to switch keyboard for ime assist + optimize fallback
- 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.
2025-07-06 20:04:58 -07:00
Benjamin Wiegand e3ef2dce21 add permission request overlay and use it for switching keyboard
the ime input switcher only shows if you have foreground context when you request it. so this overlay provides that.
2025-07-06 02:12:29 -07:00
Benjamin Wiegand 22e49e9f30 make soft keyboard popup usable with fake dpad 2025-07-06 02:06:19 -07:00
Benjamin Wiegand a53a472380 always show on-screen keyboard popup 2025-07-05 16:27:22 -07:00
Benjamin Wiegand bc9ac048a2 always show "switch back to on-screen keyboard" button 2025-07-05 16:25:52 -07:00
Benjamin Wiegand fa5c7b9c21 fix ime not capturing hardware inputs 2025-07-05 16:24:39 -07:00
Benjamin Wiegand 45133dc501 update ime logging 2025-07-05 16:23:04 -07:00
Benjamin Wiegand c822934810 track select button state for fallback
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)
2025-07-03 05:31:35 -07:00
Benjamin Wiegand a4296c4db9 silence ui update logs 2025-07-02 05:21:29 -07:00
Benjamin Wiegand 1e982f5a25 fix accessibility overlay error handling 2025-07-02 05:16:21 -07:00
Benjamin Wiegand ef1936b7f6 make fake focus highlight track node 2025-07-02 05:07:16 -07:00
Benjamin Wiegand b6cb0ea514 update documentation and add additional fake focus search fallback
as it turns out, adding those extra events fixed the scrolling bug. nice.
2025-07-02 02:20:30 -07:00
Benjamin Wiegand 62a19d44c2 check fake focus validity on ui window/focus update 2025-07-02 01:49:28 -07:00
Benjamin Wiegand 76b9a5451a fix isFocused() check during focus upgrade 2025-07-02 01:47:48 -07:00
Benjamin Wiegand b5439cc78c receive ui update events to more reliably detect dropped ime key events
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.
2025-07-02 01:22:00 -07:00
Benjamin Wiegand b61fd740f1 remove fake focus overlay from wm when not being used 2025-07-02 00:10:02 -07:00
Benjamin Wiegand 49f1b8e786 show fake focus highlight 2025-07-02 00:01:53 -07:00
Benjamin Wiegand 61213f5d0a refactor to remove debug overlay 2025-06-30 21:04:07 -07:00
Benjamin Wiegand 64a441f27f refactor/improve fake dpad
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)
2025-06-30 19:42:32 -07:00
Benjamin Wiegand 0659d8b467 add constant for network debug logging
the debug logs for rx/tx and fixed port number are a change I've had locally for a while, but this makes it less annoying to manage git
2025-06-30 17:06:53 -07:00
Benjamin Wiegand cba1ffe099 reduce media session logging 2025-06-30 16:57:01 -07:00
Benjamin Wiegand 2db39029b6 log cache misses 2025-06-30 16:51:52 -07:00
Benjamin Wiegand 67a3b7bdda workaround for fake dpad on google tv home screen 2025-06-29 23:22:30 -07:00
Benjamin Wiegand af4a8b868f implement fake hover
fake dpad can now control ime switcher

still needs a visual hover effect
2025-06-29 23:20:57 -07:00
Benjamin Wiegand 07a15d973e add a cache for focused nodes
improves fake dpad speed and dramatically improves the speed of dropped ime key event detection. the latter a little too much.
2025-06-29 17:12:52 -07:00
Benjamin Wiegand f35fae6b4b ignore own soft keyboard 2025-06-29 14:23:28 -07:00
Benjamin Wiegand 5bb7b12ea6 implement ime keyboard fallback and switch prompt
I've decided to implement the fallbacks by chaining input handlers for flexibility
2025-06-29 14:23:02 -07:00
Benjamin Wiegand b9e97a3fbd separate back button from main navigation input
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.
2025-06-29 12:57:34 -07:00
Benjamin Wiegand 9d08b8bf50 send more data in key events 2025-06-27 16:55:48 -07:00
Benjamin Wiegand d8ea72a08b refactor + split accessibility dpad and assisted ime dpad into separate input handlers
as much as I want a better option, the assisted ime input handler needs to be in the accessibility service
2025-06-27 16:52:18 -07:00
Benjamin Wiegand d65db37f59 get control sources via callbacks
allows for flexibility, particularly to implement fallbacks easier
2025-06-27 11:22:05 -07:00
Benjamin Wiegand 31448a8017 add default editor action operation 2025-06-25 18:35:44 -07:00
Benjamin Wiegand 0558ddee54 implement accessibility service keyboard input
likely will use this as a fallback for newer TVs
2025-06-25 16:50:05 -07:00
Benjamin Wiegand 40f07c0738 handle fake long press 2025-06-24 19:31:37 -07:00
Benjamin Wiegand 6d32722e76 add ime not enabled/selected error messages
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.
2025-06-23 14:19:58 -07:00
Benjamin Wiegand 8627f88392 throttle fallback
without this you can cause problems by just holding the dpad in a direction.
2025-06-22 01:06:37 -07:00
Benjamin Wiegand 27ebaa83e7 fix ime text input for some apps 2025-06-21 21:35:24 -07:00
Benjamin Wiegand 7d0c698612 don't use fallback for dpad select 2025-06-21 18:49:01 -07:00
Benjamin Wiegand cb40322f84 attempt to detect ime dpad failure and fall back to fakeDpad()
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.
2025-06-21 18:19:23 -07:00
Benjamin Wiegand f8760e9896 always attempt to use accessibility assist for now 2025-06-21 17:46:29 -07:00
Benjamin Wiegand 112c5e8486 fix duplicated inputs 2025-06-21 16:52:04 -07:00
Benjamin Wiegand 070af316c4 add basic protocol support for keyboard 2025-06-20 20:51:23 -07:00
Benjamin Wiegand 0de479ac3c implement more ime controls
- 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)
2025-06-20 19:16:54 -07:00
Benjamin Wiegand c4a884aef8 add more buttons for debugging ime dpad 2025-06-20 19:07:01 -07:00
Benjamin Wiegand a33b29d5fa add missing layout for debug spinner 2025-06-18 17:41:19 -07:00
Benjamin Wiegand f7810eaee6 keycode logic
- 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
2025-06-18 17:40:56 -07:00
Benjamin Wiegand e4f3c72979 show keyboard focusable nodes in debug overlay 2025-06-18 11:47:42 -07:00
Benjamin Wiegand 7fe2dfe59f add debug option for showing different types of nodes 2025-06-18 11:46:35 -07:00
Benjamin Wiegand cf3493dfcb add feedbackGeneric
as it turns out, not defining feedback causes issues. feedbackGeneric seems to not trigger the tts reader from earlier
2025-06-18 10:21:07 -07:00
Benjamin Wiegand 9379972c44 call show() on ui thread 2025-06-18 02:18:14 -07:00
Benjamin Wiegand a756f63f39 remove feedbackSpoken
gets rid of built-in tts on some apps
2025-06-18 01:56:19 -07:00
Benjamin Wiegand 4bd9f25f51 manage visibility of notification overlay 2025-06-18 01:55:25 -07:00
Benjamin Wiegand f52eb7090e make the ui darker and use appropriate attributes in pairing dialog 2025-06-18 01:32:07 -07:00
Benjamin Wiegand a0fe7b37ba add sdk level check 2025-06-18 01:31:30 -07:00
Benjamin Wiegand 8c35270613 implement "ime dpad with accessibility assist"
- 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
2025-06-18 01:28:12 -07:00
Benjamin Wiegand e270c98c1e check if child node is null 2025-06-18 01:18:37 -07:00
Benjamin Wiegand fd2d679706 remove incorrect comment
I didn't consider that the software keyboard overlay might interfere with the dpad functionality while testing.

it does work on api 35
2025-06-16 09:27:37 -07:00
Benjamin Wiegand edf8f0988a implement dpad long press
not optimal, but better than it not working
2025-06-16 09:23:53 -07:00
Benjamin Wiegand a4c0b88984 clean log messages
reduce log spam make the messages more helpful
2025-06-16 08:57:19 -07:00
Benjamin Wiegand 51bca4469d update debug buttons
- 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
2025-06-16 08:43:24 -07:00
Benjamin Wiegand 277ed81e14 refactor 2025-06-16 08:05:45 -07:00
Benjamin Wiegand c6be5fd42b add IMEInputService with directional pad emulation
it works much better than I ever anticipated. so much so that fixing up fakeDpad feels like it was a waste of time
2025-06-16 08:04:10 -07:00
Benjamin Wiegand d41d06609d create MakeshiftBind alternative for the binder api
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.
2025-06-16 03:11:02 -07:00
Benjamin Wiegand c6391b7740 use keyboard window instead of focused node
works better with changing focus and prevents disappearing nodes from breaking it
2025-06-14 17:45:37 -07:00
Benjamin Wiegand 8f6553f1bd remove pointless debug button and reorder
(yes, I have a script that presses the down arrow 5 times)
2025-06-14 17:14:43 -07:00
Benjamin Wiegand b464df2c7f don't show debug overlay by default + more refactoring 2025-06-14 17:10:25 -07:00
Benjamin Wiegand b9d6523be6 refactor 2025-06-14 17:03:30 -07:00
Benjamin Wiegand d3fd53a646 more debug boxes
highlights the first focusable node in every window.
I used this while debugging the soft keyboard.
2025-06-14 15:53:28 -07:00
Benjamin Wiegand b3be6a520a watch for soft keyboard window and allow control of it with fakeDpad() 2025-06-14 15:52:40 -07:00
Benjamin Wiegand abf442fa6e include "not important for accessibility" views 2025-06-14 12:21:34 -07:00
Benjamin Wiegand 85e80a33a0 add some debug rectangles 2025-06-14 12:20:44 -07:00
Benjamin Wiegand 6658671cfa only run in handler if not already in main looper
this is the correct behavior of runOnUiThread()
2025-06-14 12:19:37 -07:00
Benjamin Wiegand 751a16e4f6 fix node traversal 2025-06-14 12:15:52 -07:00
Benjamin Wiegand 433ead4bb4 cleanup 2025-06-13 16:54:24 -07:00
Benjamin Wiegand b36b11e1be improve reliability of fakeDpad()
- gave it the correct flags to avoid null window root issue
- seeks first focusable when there is no focus
- greatly refactored
2025-06-13 15:49:40 -07:00
Benjamin Wiegand 9fbf4518b2 set correct bounds for mouse cursor
prevents issue where you can move the mouse outside of the clickable area by a single pixel
2025-06-13 10:10:26 -07:00