Replies: 2 comments 1 reply
-
No info on what you are actually trying to listen to and what you intend to do with the events. I suggest you read https://github.com/termux/termux-community/blob/site/site/pages/en/rules/how-to-ask-report-and-request.md And you likely should be able to use apps like Tasker and/or AutoInput to listen and react to events which use android accessibility service instead of a for loop. |
Beta Was this translation helpful? Give feedback.
-
I am trying to listen for hardware keypresess in order to add additional actions when the power or volume buttons are pushed. I don't see why my reason for doing so is necessary to answer my question though. I have tasker and auto input and I am also trying to do this with that but I do not understand how to create tasks very well and also I encountered a bug that prevented me from doing what I want with Tasker which I contacted the dev about and is helping me with. All I see for Auto Input is how to detect the coordinates of a touch on the screen not hardware key presses. And on the tasker wiki, it actually said detecting keypresess is not possible but I don't believe that.
|
Beta Was this translation helpful? Give feedback.
-
This command works in adb: getevent -lc4 /dev/input/event0 but I can't use wireless debugging because it gets disabled every time I reboot.
I don't know how well this will work for what I want to do unless I have a wakelock because the battery life on my Pixel 8a is not that great. Is there a way to listen for events such as hardware keypresses without having an endless loop keeping the CPU awake?
Beta Was this translation helpful? Give feedback.
All reactions