public void run() {
if (isPressed()) {
if (mCode != 0) {
if (mCode == KeyEvent.KEYCODE_DPAD_LEFT || mCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
sendEvent(KeyEvent.ACTION_UP, KeyEvent.FLAG_SOFT_KEYBOARD |
KeyEvent.FLAG_KEEP_TOUCH_MODE, System.currentTimeMillis(), false);
sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_SOFT_KEYBOARD |
KeyEvent.FLAG_KEEP_TOUCH_MODE, System.currentTimeMillis(), false);
removeCallbacks(mCheckLongPress);
postDelayed(mCheckLongPress, ViewConfiguration.getKeyRepeatDelay());
} else {
sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS);
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
}
} else {
mLongPressConsumed = performLongClick();
}
}
}
KeyButtonView.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:GravityBox
作者:
评论列表
文章目录