KeyMapper icon indicating copy to clipboard operation
KeyMapper copied to clipboard

Feature request: catch-all intent receiver that sends keys specified in an intent

Open sudomain opened this issue 3 years ago • 3 comments

Developer TODO (don't remove)

  • [ ] create new branch. put issue number at start of name
  • [ ] update documentation
  • [ ] squash and merge
  • [ ] delete branch

Sorry if the title is poorly worded. Feel free to change it. I want to send KeyMapper a new type of intent containing keys/text that I want sent. I'm aware of how to trigger a map using an intent and the keycode actions, but sending a different intent for each keycode would involve manually creating a map for each of the 200+ keycodes that KeyMapper supports.

My end goal (which I probably should've started this post with) is to remote control an Android device using intents (am) and tool such as SSH. I currently have an embarrassingly bad bash script that reads user input (REPL-style) and sends a limited set of intents to KeyMapper using am. I'd like to be able to do something like io.github.sds100.keymapper.ACTION_TRIGGER_SEND_KEYS with an EXTRA_TEXT containing what I want KeyMapper to type.

EDIT: My end goal is something similar in behavior to xdotool but using intents since we're working with Android and not an X server

sudomain avatar Dec 28 '21 18:12 sudomain

This is a good idea

sds100 avatar Dec 28 '21 20:12 sds100

Note to self (or another dev if I forget): This functionality is similar to what ADBKeyBoard does. As an example it allows: am broadcast -a ADB_INPUT_TEXT --es msg 'Hello? to send Hello?.

In fact, it does exactly what I was looking for with this feature request. It may still be helpful to integrate the same functionality into the KeyMapper input method. I may attempt it some day, but I think it would take longer for me to add this feature than it would for me to switch input methods (which I can automate :) )

sudomain avatar Aug 04 '23 04:08 sudomain

If I or another Dev tried to incorporate this, would it be better suited in this app (meaning the basic KeyMapper input method) or https://github.com/keymapperorg/KeyMapperKeyboard ? I'm thinking the latter because it's already more advanced

sudomain avatar Aug 04 '23 16:08 sudomain