0

Some (non textinput) apps on Android support ctrl+z /ctrl+y etc commands.

I'd like to simulate the ctrl+z even via shell/adb (in the worst case I can use root to force shell execution)

I know that input keyevent 114

input keyevent 57

f.e. correspondent to "Ctrl" and "Z"

But am not sure how to apply "hold" to the first keyevent until the second fires.

Others also failed at this... Send CTRL + T over ADB using sendevent or input keyevent https://gist.github.com/arjunv/2bbcca9a1a1c127749f8dcb6d36fb0bc Simulating combination of key presses from ADB terminal

Rye
  • 49
  • 5
  • Just confirming that you have tried and can't use `KEYCODE_CUT`, `KEYCODE_COPY`, and `KEYCODE_PASTE`, https://developer.android.com/reference/android/view/KeyEvent.html – Morrison Chang Dec 05 '21 at 05:05
  • Have you tried: **ctrl-y** `input keyevent --longpress 113 & input keyevent --longpress 113 & input keyevent 53` and **ctrl-z** `input keyevent --longpress 113 & input keyevent --longpress 113 & input keyevent 54`? – Darkman Dec 05 '21 at 07:29
  • @MorrisonChang: I'm deliberately trying to invoke ctrl+z, as apps like IbisPaint f.e. react to that keycombo only, but your attempt is useful, I took note of it. Darkman Those look interesting, but they dont really *do* anything when launched from tasker or another shell interpreter, is there special formatting required ? – Rye Dec 05 '21 at 17:54

0 Answers0