Android Question Simulate Key Press?

How to simulate key press? Eg when a web hook is triggered or when BLE device is near (based on RSSI), can we simulate Volume up button in b4a? I just need code for simulation of any key press
Do you want to send the key press to other apps or to your app?

It is not possible to send key presses to other apps. It used to be possible with the accessibility service but it is now more restricted.
I wanted to send key press to other apps, but I don't know how to send to own apps either, so code for sending to own app is welcome too.
Upvote 0