[android开发] Android应用程序输入事件处理机制

[复制链接]
发表于 2022-11-9 10:38:12
在Android使用程序中,有一类特别的消息,是专门担任与用户进行交互的,它们就是接触屏和键盘等输入事情。接触屏和键盘事情是统一由系统输入管理器InputManager进行分发的。也就是说,InputManager担任从硬件接收输入事情,然后再将接收到的输入事情分发当时激活的窗口管理。此外,InputManager也能接收模拟的输入事情,用来模拟用户接触和点击等事情。当时激活的窗口所运行在的线程接收到InputManager分发过来的输入事情之后,会将它们封装成输入消息,然后交给当时获得焦点的控件管理。这个PPT讲Android使用程序输入事情的分发和管理进程,主要涉及到输入管理InputManager、输入事情监控线程InputReader、输入事情分发线程InputDispatcher,以及使用程序主线程消息循环。

(In the Android user program, there is a special kind of message that is specially used to interact with users. They are touch screen, keyboard and other input things. The touchscreen and keyboard events are uniformly distributed by the system input manager InputManager. In other words, the InputManager is responsible for receiving input events from the hardware, and then distributing the received input events to the active window management. In addition, Input Manager can also receive simulated input events to simulate user contact, click and other events. After the thread running the activated window receives the input events distributed by the InputManager, it will encapsulate them into input messages and then give them to the control that gets the focus at that time for management. This PPT talks about the distribution and management process of Android using programs to input events, mainly involving input management InputManager, input event monitoring thread InputReader, input event distribution thread InputDispatcher, and using the main thread message loop of the program.)

[下载]10381218239.rar




上一篇:Android硬件抽象层(HAL)
下一篇:Dalvik虚拟机

使用道具 举报

Archiver|手机版|小黑屋|吾爱开源 |网站地图

Copyright 2011 - 2012 Lnqq.NET.All Rights Reserved( ICP备案粤ICP备14042591号-1粤ICP14042591号 )

关于本站 - 版权申明 - 侵删联系 - Ln Studio! - 广告联系

本站资源来自互联网,仅供用户测试使用,相关版权归原作者所有

快速回复 返回顶部 返回列表