senzhk / ADBKeyBoard

Android Virtual Keyboard Input via ADB (Useful for Test Automation)
GNU General Public License v2.0
1.22k stars 299 forks source link

Fixing some issues on sending meta key codes #49

Closed truong0vanchien closed 2 years ago

truong0vanchien commented 2 years ago

The app is broken with meta key codes on modern androids. I already tested on some Android 8+ devices, not only real devices but also emulators. Therefore, I modified the function in order to make it work. Now I can send Ctrl + A as below: _4096 is META_CONTROL_ON, 8192 is META_CONTROL_LEFT_ON, 29 is KEYCODEA adb shell am broadcast -a ADB_INPUT_TEXT --es mcode '4096,29' // one metaState. or adb shell am broadcast -a ADB_INPUT_TEXT --es mcode '4096^|^8192,29' // two metaState. Anyways, I appreciate your works.

senzhk commented 2 years ago

Thanks,

but I found out the command is not working on Mac: adb shell am broadcast -a ADB_INPUT_TEXT --es mcode '4096^|^8192,29' /system/bin/sh: ^8192,29: inaccessible or not found

senzhk commented 2 years ago

fixed.