![日記 日記](https://srad.jp/static/topics/journal_64.png)
bhindの日記: monkeyrunnerのmulti touch対応
仕事でmonkeyrnnnerを調べてたのだが、どうもmulti touchはできない様子。
ってそもそもどうやって指定したらええねんと思ったのでまずは調べてみた。
ひとまずオフィシャルを参考にadb getevent -lt...とすると、「ABS_MT_SLOT」やら「ABS_MT_TRACKING_ID」が。
えーなにこれーといいながらgoogle先生にきいてみたところkernel.orgのドキュメントにたどり着きました。
Protocol Example B
------------------Here is what a minimal event sequence for a two-contact touch would look
like for a type B device:ABS_MT_SLOT 0
ABS_MT_TRACKING_ID 45
ABS_MT_POSITION_X x[0]
ABS_MT_POSITION_Y y[0]
ABS_MT_SLOT 1
ABS_MT_TRACKING_ID 46
ABS_MT_POSITION_X x[1]
ABS_MT_POSITION_Y y[1]
SYN_REPORTHere is the sequence after moving contact 45 in the x direction:
ABS_MT_SLOT 0
ABS_MT_POSITION_X x[0]
SYN_REPORTHere is the sequence after lifting the contact in slot 0:
ABS_MT_TRACKING_ID -1
SYN_REPORTThe slot being modified is already 0, so the ABS_MT_SLOT is omitted. The
message removes the association of slot 0 with contact 45, thereby
destroying contact 45 and freeing slot 0 to be reused for another contact.Finally, here is the sequence after lifting the second contact:
ABS_MT_SLOT 1
ABS_MT_TRACKING_ID -1
SYN_REPORT
とりあえず、へーって感じに。Protocol Aにしか対応してない機種は今回相手にしてないので、とりあえずスルー。
つまりは、ABS_MT_SLOTとかABS_MT_TRACKING_IDで複数指定できるよって感じみたいな認識。
ということは、ChimpManagerあたりにSLOT指定可能なシグネチャにかえればいんじゃね?。。。それでいいのかなぁ?(´・ω・`)まあリリース時にffffでIDとばしとかしないといけないから、やっぱその上のレイヤーで統括的にしないと、ってそれじゃあAdbChimpDeviceから下つくりなおしなの?
いいや、仕事中に時間がとれたらチャレンジしてみよ。。。
P.S. macのUSB経由のadbの件は、IOUSBFamily with logginというloggerを仕込んで、ここを参考にロギングしてみたけどらちあかず、、、(まあ、データも8bytes分しかみれないし。。。)adbを改造してlocal buildしたいのだけどそこまで気力が追いつかないので保留。。。(´;ω;`)これは症状は似てるけどUSB3の話っぽいのでうちのとは関係ないかも。。。
monkeyrunnerのmulti touch対応 More ログイン