Inputreader.cpp里virtualkey的流程
来源:互联网 发布:js调用相机扫描条形码 编辑:程序博客网 时间:2024/06/16 09:47
首先是
void TouchInputMapper::process(const RawEvent* rawEvent) {
if (rawEvent->type == EV_SYN && rawEvent->code == SYN_REPORT) {
ALOGD("matt- TouchInputMapper::process ");
sync(rawEvent->when);
}
}
然后是
void TouchInputMapper::sync(nsecs_t when) {
ALOGD("matt- TouchInputMapper::sync ");
processRawTouches(false /*timeout*/);
}
之后是
oid TouchInputMapper::processRawTouches(bool timeout) {
ALOGD("matt-processRawTouches");
cookAndDispatch(mCurrentRawState.when);
}
到了
void TouchInputMapper::cookAndDispatch(nsecs_t when) {
// Always start with a clean state.
mCurrentCookedState.clear();
ALOGD("matt-cookAndDispatch");
if (consumeRawTouches(when, policyFlags)) {
mCurrentRawState.rawPointerData.clear();
}
}
之后是
bool TouchInputMapper::consumeRawTouches(nsecs_t when, uint32_t policyFlags) {
// Check for release of a virtual key.
if (mCurrentVirtualKey.down) {
if (mCurrentRawState.rawPointerData.touchingIdBits.isEmpty()) {
// Pointer went up while virtual key was down.
mCurrentVirtualKey.down = false;
if (!mCurrentVirtualKey.ignored) {
#if DEBUG_VIRTUAL_KEYS
ALOGD("matt-VirtualKeys: Generating key up: keyCode=%d, scanCode=%d",
mCurrentVirtualKey.keyCode, mCurrentVirtualKey.scanCode);
#endif
然后是
void TouchInputMapper::dispatchVirtualKey(nsecs_t when, uint32_t policyFlags,
int32_t keyEventAction, int32_t keyEventFlags) {
int32_t keyCode = mCurrentVirtualKey.keyCode;
int32_t scanCode = mCurrentVirtualKey.scanCode;
nsecs_t downTime = mCurrentVirtualKey.downTime;
int32_t metaState = mContext->getGlobalMetaState();
policyFlags |= POLICY_FLAG_VIRTUAL;
NotifyKeyArgs args(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, policyFlags,
keyEventAction, keyEventFlags, keyCode, scanCode, metaState, downTime);
ALOGD("matt- getListener()->notifyKey(&args)1" );
getListener()->notifyKey(&args);
}
然后到了inputdispacher.cpp
void InputDispatcher::notifyKey(const NotifyKeyArgs* args) {
//#if DEBUG_INBOUND_EVENT_DETAILS
ALOGD("notifyKey - eventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, action=0x%x, "
"flags=0x%x, keyCode=0x%x, scanCode=0x%x, metaState=0x%x, downTime=%lld",
args->eventTime, args->deviceId, args->source, args->policyFlags,
args->action, args->flags, args->keyCode, args->scanCode,
args->metaState, args->downTime);
//#endif
- Inputreader.cpp里virtualkey的流程
- Android中InputManagerService里的InputReader和inputDispatcher
- Android Input流程分析(三):InputReader
- 定义不一定在相应的cpp里
- CPP里的指针和引用
- Shell里的流程控制
- Shell里的流程控制
- settings里的 wifi流程
- android inputreader 部分对event数据的处理
- 如何在inputreader中拦截相应的virtual key
- 分析一下android2.3中SensorBase.cpp的程序流程
- 正确的是在.h里声明,在.cpp里定义
- UE4 蓝图里添加Cpp文件,不在VS解决方案里显示的问题
- live555ProxyServer.cpp分析:初始化流程
- cpp-empty-test 程序流程
- c与cpp的相互混合应用(c嵌入到cpp里或者cpp嵌入到c里) extern c和_cplusplus(一般在c库里合用)的来历
- #ifndef 头文件卫士 只防止一个.cpp里的重定义(因为#define只作用于一个.cpp),而不是多个.cpp
- #ifndef 头文件卫士 只防止一个.cpp里的重定义(因为#define只作用于一个.cpp),而不是多个.cpp
- 从开发者角度解析 Android N 新特性!
- JVM梳理
- Codeforces--598A--Tricky Sum(数学)
- 送给前线码农的话 - 大牛们的经典语录
- CentOs6.5中安装和配置vsftp简明教程
- Inputreader.cpp里virtualkey的流程
- CODE[VS] 1079 回家
- Java并发编程(一)
- iOS之Runtime
- Java之String中删除指定元素
- HighCharts 详细使用及API文档说明
- kidd风的IOS日志之Source Tree的使用教程
- Python之getopt模块
- AP: average precision