android.app.Instrumentation.sendKeySync()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(404)

本文整理了Java中android.app.Instrumentation.sendKeySync()方法的一些代码示例,展示了Instrumentation.sendKeySync()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instrumentation.sendKeySync()方法的具体详情如下:
包路径:android.app.Instrumentation
类名称:Instrumentation
方法名:sendKeySync

Instrumentation.sendKeySync介绍

暂无

代码示例

代码示例来源:origin: android-hacker/VirtualXposed

@Override
public void sendKeySync(KeyEvent event) {
  base.sendKeySync(event);
}

代码示例来源:origin: bzsome/VirtualApp-x326

@Override
public void sendKeySync(KeyEvent event) {
  base.sendKeySync(event);
}

代码示例来源:origin: darkskygit/VirtualApp

@Override
public void sendKeySync(KeyEvent event) {
  base.sendKeySync(event);
}

代码示例来源:origin: stackoverflow.com

final Instrumentation mInst = new Instrumentation();

mInst.sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN, keycode));
mInst.sendKeySync(new KeyEvent(KeyEvent.ACTION_UP, keycode));

代码示例来源:origin: stackoverflow.com

final Instrumentation instrumentation = getInstrumentation();
       final long downTime = SystemClock.uptimeMillis();
       final long eventTime = SystemClock.uptimeMillis();
       final KeyEvent altDown = new KeyEvent(downTime, eventTime, KeyEvent.ACTION_DOWN,
           KeyEvent.KEYCODE_GRAVE, 1, KeyEvent.META_ALT_LEFT_ON);
       final KeyEvent altUp = new KeyEvent(downTime, eventTime, KeyEvent.ACTION_UP,
           KeyEvent.KEYCODE_GRAVE, 1, KeyEvent.META_ALT_LEFT_ON);
       instrumentation.sendKeySync(altDown);
       instrumentation.sendCharacterSync(KeyEvent.KEYCODE_A);
       instrumentation.sendKeySync(altUp);
       instrumentation.sendKeySync(altDown);
       instrumentation.sendCharacterSync(KeyEvent.KEYCODE_E);
       instrumentation.sendKeySync(altUp);
       instrumentation.sendKeySync(altDown);
       instrumentation.sendCharacterSync(KeyEvent.KEYCODE_I);
       instrumentation.sendKeySync(altUp);
       instrumentation.sendKeySync(altDown);
       instrumentation.sendCharacterSync(KeyEvent.KEYCODE_O);
       instrumentation.sendKeySync(altUp);
       instrumentation.sendKeySync(altDown);
       instrumentation.sendCharacterSync(KeyEvent.KEYCODE_U);
       instrumentation.sendKeySync(altUp);

代码示例来源:origin: EggUncle/XposedNavigationBar

@Override
protected void longHome() {
  KeyEvent keyEvent = new KeyEvent(KeyEvent.FLAG_LONG_PRESS, KeyEvent.KEYCODE_HOME);
  mInst.sendKeySync(keyEvent);
}

代码示例来源:origin: luili16/UIMocker

@Override
@CallSuper
public void sendKeySync(KeyEvent event) {
  if (DEBUG) {
    Logger.d(TAG,"sendKeySync");
  }
  mInstrumentation.sendKeySync(event);
}

代码示例来源:origin: EggUncle/XposedNavigationBar

@Override
  protected void showPowerMenu(Context context) {
    Instrumentation mInst = new Instrumentation();
    KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_POWER);
    mInst.sendKeySync(keyEvent);
  }
}

相关文章

Instrumentation类方法