Jinnrry/RobotHelper

物理按键应该怎么写?

zx900930 opened this issue · 2 comments

比如点击back, home, menu之类的按键

xposed模式

InstrumentationInput.sendKeyDownUpSync( KeyEvent.xxxxx);

root模式,将对应的硬件指令发送到sendevent,

无障碍模式

https://blog.csdn.net/tanmx219/article/details/81270404

无障碍模式,在class Accessibility里写function解决了

public void pressBack(){
//       performGlobalAction(GLOBAL_ACTION_RECENTS);
        performGlobalAction(GLOBAL_ACTION_BACK);
//        performGlobalAction(GLOBAL_ACTION_HOME)
//        performGlobalAction(GLOBAL_ACTION_NOTIFICATIONS)
//        performGlobalAction(GLOBAL_ACTION_POWER_DIALOG)
//        performGlobalAction(GLOBAL_ACTION_QUICK_SETTINGS)
//        performGlobalAction(GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN)
    }