keymapperorg / KeyMapper

An Android app that change what the buttons do on your devices!
http://docs.keymapper.club
GNU General Public License v3.0
1.13k stars 156 forks source link

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

Open sudomain opened 2 years ago

sudomain commented 2 years ago

Developer TODO (don't remove)

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

sds100 commented 2 years ago

This is a good idea

sudomain commented 1 year ago

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 commented 1 year ago

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