CH554實(shí)現(xiàn)鼠標(biāo)功能的滾輪問題

我司目前想通過CH554通過串口接收Android主板USB mouse事件(比如mouse 坐標(biāo)以及滾輪事件(前滾,后滾)基本功能)來實(shí)現(xiàn)對(duì)其他PC的反控功能。目前實(shí)現(xiàn)可以進(jìn)行鼠標(biāo)左邊、右鍵以及鼠標(biāo)移動(dòng)的反控,但是wheel控制時(shí),被反控的windows端沒有反應(yīng)。目前Android下發(fā)的wheel前滾后滾事件被映射成0x01, 0xff兩個(gè)值,我這邊的報(bào)告描述符如下:

??????0x05,?0x01,????????//?Usage?Page?(Generic?Desktop?Ctrls)
????0x09,?0x02,????????//?Usage?(Mouse)
????0xA1,?0x01,????????//?Collection?(Application)
????0x85,?MOUSE_EVT_REPORT_ID,????????/*?REPORT_ID?(04)?*/
????0x09,?0x01,????????//???Usage?(Pointer)
????0xA1,?0x00,????????//???Collection?(Physical)
????/*1byte?for?button*/
????0x05,?0x09,????????//?????Usage?Page?(Button)
????0x19,?0x01,????????//?????Usage?Minimum?(0x01),?1?left?key,?2?right?key,?3?middle?key
????0x29,?0x03,????????//?????Usage?Maximum?(0x03)
????0x15,?0x00,????????//?????Logical?Minimum?(0)
????0x25,?0x01,????????//?????Logical?Maximum?(1)
????0x75,?0x01,????????//?????Report?Size?(1):?
????0x95,?0x03,????????//?????Report?Count?(3):?3bit?to?describe?key?event,?bit-0{left},?bit-1{right},?bit-2{middle};?set?1?for?press,?0?for?release
????0x81,?0x02,????????//?????Input?(Data,Var,Abs,No?Wrap,Linear,Preferred?State,No?Null?Position)
????0x75,?0x05,????????//?????Report?Size?(5)
????0x95,?0x01,????????//?????Report?Count?(1):?5bit?padding?for?byte?align,?should?set?all?0
????0x81,?0x03,????????//?????Input?(Const,Array,Abs,No?Wrap,Linear,Preferred?State,No?Null?Position)
????0x05,?0x01,????????//?????Usage?Page?(Generic?Desktop?Ctrls)
????0x09,?0x38,????????//?????USAGE?(Wheel)
????0x15,?0x81,?????????//????????Logical?Minimum?(127)
????0x25?,?0x7f,?????????//???????LOGIC_MAX?(-127):?0x01?scroll?forward,?0xff:?scroff?back
????0x75,?0x08,??????????//???????REPORT_SIZE?(8)
????0x95,?0x01,??????????//???????REPORT_COUNT?(1)
????0x81,?0x06,????????????//?????Input?(Data,Var,Res,No?Wrap,Linear,Preferred?State,No?Null?Position)

????0x09?,?0x30?,??????//???????USAGE?X?
????0x15,?0x00,?????????//????????Logical?Minimum?(0)
????0x26?,?0x00?,?0x10,??//???????LOGIC_MAX?(0X1000)?
????0x35?,?0x00?,????????//???????PHYSICAL_MIN?(0)
????0x46?,?0x00?,?0x10?,?//???0x79?,?0x08?????PHYSICAL_MAX?(0X1000)
????0x75,?0x10,??????????//???????REPORT_SIZE?(16)
????0x95,?0x01,??????????//???????REPORT_COUNT?(1)
????0x81?,?0x02?,????????//???????INPUT?(Data,Var,ABS)
????0x09?,?0x31?,????????//?????USAGE?Y
????0x15,?0x00,?????????//????????Logical?Minimum?(0)
????0x26?,?0x00?,?0x10,??//???????LOGIC_MAX?(0X1000)
????0x35?,?0x00?,????????//???????PHYSICAL_MIN?(0)
????0x46?,?0x00?,?0x10,??//??0x4c?,?0x05?????PHYSICAL_MAX?(0X1000)
????0x75,?0x10,??????????//???????REPORT_SIZE?(16)
????0x95,?0x01,??????????//???????REPORT_COUNT?(1)
????0x81?,?0x02?,???????//????????INPUT?(Data,Var,Abs)
????0xC0,??????????????//???End?Collection
????0xC0,??????????????//?End?Collection

還麻煩指點(diǎn)一下wheel的控制。 PS:通過USB轉(zhuǎn)包,也能看見數(shù)據(jù)包按照report描述符進(jìn)行了上報(bào),但是windows端對(duì)wheel沒啥反應(yīng)。

您好,

從發(fā)來的報(bào)告描述符看,

上傳的數(shù)據(jù)格式應(yīng)該是:

MOUSE_EVT_REPORT_ID? ,?Button ,Wheel ,X,X,Y,Y。

即第三個(gè)字節(jié)表示滾輪??梢耘浜险媸堑氖髽?biāo)抓取其滾動(dòng)時(shí)的報(bào)告輔助分析問題


我確實(shí)對(duì)真實(shí)的鼠標(biāo)滾輪進(jìn)行了抓取查看,鼠標(biāo)采用的是如下的基本配置:

0x05,0x01,?//?Global?Generic?Desktop
0x09,0x02,?//?Local?Mouse
0xa1,0x01,?//?Main?app?collection
0x09,0x01,?//?Local?Pointer
0xa1,0x00,?//?Main?phy?collection
0x95,0x03,?//?Global?ReportCount
0x75,0x01,?//?Global?ReportSize
0x05,0x09,?//?Global?Button
0x19,0x01,?//?Local?Usage?Min
0x29,0x03,?//?Local?Usage?Max
0x15,0x00,?//?Global?Logical?Min
0x25,0x01,?//?Global?Logical?Max
0x81,0x02,?//?Main?Input(Data,Var,Abs)
0x95,0x01,?//?Global?ReportCount
0x75,0x05,?//?Global?ReportSize
0x81,0x03,?//?Main?Input(Cnsr,Var,Abs)
0x95,0x03,0x75,0x08,?//?Global?ReportCount?Global?ReportSize
0x05,0x01,?//?Global?Generic?Desktip
0x09,0x30,?//?Local?X
0x09,0x31,?//?Local?Y
0x09,0x38,?//?Locak?Wheel
0x15,0x81,?//?Global?Logical?Min
0x25,0x7f,?//?Global?Logical?Max
0x81,0x06,?//?Main?Input(Data,Var,Rel)
0xc0,??????//?Main?End?collection

我抓取了鼠標(biāo)的wheel,前滾一格0x01,后滾一格0xFF, 不滾動(dòng)0x00.??

我的CH554上也通過接收android端識(shí)別到的滾輪事件來映射了這樣的鼠標(biāo)值,但是report過去后windows端沒有滾動(dòng)。但是我又沒有辦法知道windows端的驅(qū)動(dòng)到底是如何解析的我的report信息。目前左右鍵和x,y移動(dòng)都沒問題,就是滾輪沒成功。


還麻煩能否指點(diǎn)一下其他意見或者調(diào)試方式。



這個(gè)報(bào)告描述符的格式和您發(fā)的是有區(qū)別的

后面發(fā)的這個(gè)格式最后面三個(gè)字節(jié)分別是X,Y,Wheel。而且這個(gè)報(bào)告沒有report ID。

您可以試下將報(bào)告描述符改成和它一樣的內(nèi)容,再上傳和它一樣的數(shù)據(jù)格式測(cè)試。

電腦會(huì)分析報(bào)告描述符來確定報(bào)告的格式。


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频