There are some problems with the transmission of a TV key event, but the five-bit arrow keys sometimes have problems
so using activity completely takes over the transfer of the key event, controlling the change of focus and the pressing processing logic of the five-bit direction key .
Review The key event delivery here, the log is as follows
The key event is assigned from the activity, then the view is processed first, and the last activity is processed
Touch Events
View.java only dispatchtouchevent and Ontouchevent
VG only Dispatchtouchevent and Onintercepttouchevent one more dispatchtransformedtouchevent . Vg.java No outouchevent, VG's ontouchevent is actually a VG inherited view, and touch processing is the same as view.
Complete Process:
1.vg.dispatchtouchevent
2.vg.onintercepttouchevent-if intercepted, then directly execute my own Ontouch (that is, super.dispatchtouchevent )
3.vg.dispatchtransformedtouchevent
if onintercepttouchevent returns not true, that is, it is not intercepted, then it is distributed to the child, and if there is no child, perform the touch of my own view
two cases are as follows: 4. Traverse all the children in this VG:
A If there are no children in this VG, call this VG's view of the dispatchtouchevent that is super.dispatchtouchevent
B Otherwise, perform the children's Ontouch.
5.super.dispatchtouchevent will eventually execute to:
Montouchlistener.ontouch
6. Ontouchevent (event)
Finally, the WMS invokes the activity's ontouchevent
Notes KeyEvent and TouchEvent in the order in which the activity and view are passed