下面是单点触摸描述符。
0x05, 0x0d, // USAGE_PAGE (Digitizers) 0
0x09, 0x04, // USAGE (Touch Screen) 2
0xa1, 0x01, // COLLECTION (Application) 4
0x85, 0xaa, // REPORT_ID (Touch) 6
0x09, 0x20, // USAGE (Stylus) 8
0xa1, 0x00, // COLLECTION (Physical) 10
0x09, 0x42, // USAGE (Tip Switch) 12
0x15, 0x00, // LOGICAL_MINIMUM (0) 14
0x25, 0x01, // LOGICAL_MAXIMUM (1) 16
0x75, 0x01, // REPORT_SIZE (1) 18
0x95, 0x01, // REPORT_COUNT (1) 20
0x81, 0x02, // INPUT (Data,Var,Abs) 22
0x95, 0x03, // REPORT_COUNT (3) 24
0x81, 0x03, // INPUT (Cnst,Ary,Abs) 26
0x09, 0x32, // USAGE (In Range) 28
0x09, 0x37, // USAGE (Data Valid-Finger) 30
0x95, 0x02, // REPORT_COUNT (2) 32
0x81, 0x02, // INPUT (Data,Var,Abs) 34
0x95, 0x0a, // REPORT_COUNT (10) 36
0x81, 0x03, // INPUT (Cnst,Ary,Abs) 38
0x05, 0x01, // USAGE_PAGE (Generic Desktop) 40
0x26, 0xff, 0x7f, // LOGICAL_MAXIMUM (32767) 42
0x75, 0x10, // REPORT_SIZE (16) 45
0x95, 0x01, // REPORT_COUNT (1) 47
0xa4, // PUSH 49
0x55, 0x0d, // UNIT_EXPONENT (-3) 50
0x65, 0x00, // UNIT (None) 52
0x09, 0x30, // USAGE (X) 54
0x35, 0x00, // PHYSICAL_MINIMUM (0) 56
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0) 58
0x81, 0x02, // INPUT (Data,Var,Abs) 61
0x09, 0x31, // USAGE (Y) 63
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0) 65
0x81, 0x02, // INPUT (Data,Var,Abs) 68
0xb4, // POP 70
0x05, 0x0d, // USAGE PAGE (Digitizers) 71
0x09, 0x60, // USAGE (Width) 73
0x09, 0x61, // USAGE (Height) 75
0x95, 0x02, // REPORT_COUNT (2) 77
0x81, 0x02, // INPUT (Data,Var,Abs) 79
0x95, 0x01, // REPORT_COUNT (1) 81
0x81, 0x03, // INPUT (Cnst,Ary,Abs) 83/85
0xc0, // END_COLLECTION 0/1
0xc0 , // END_COLLECTION 0/1
For Windows 7, touch digitizers appear through HID as a touch digitizer (page 0x0D, usage 0x04).
The following usages are required:
·
X (page 0x01, usage 0x30) and Y (page 0x01, usage 0x31).
·
Tip switch (page 0x0D, usage 0x42).
·
In-range (page 0x0D, usage 0x32).
Use tip switch to indicate finger contact and liftoff from the digitizer surface, similar to how a pen reports contact with the digitizer.
If the device supports z-axis detection, it reports in-range correctly. If the device does not support z-axis detection, the driver reports packets with in-range and tip switch set when a finger comes in contact with the digitizer.
Note that some earlier versions of Windows have different guidelines for how touch digitizer drivers should handle in-range reporting. The Windows XP Tablet PC OEM Preinstallation Kit (OPK) includes information about how to implement a touch digitizer driver for Windows XP. For more information, contact your Microsoft technical account manager.
The following usages are optional, but you should implement them if the digitizer hardware supports them:
·
Confidence (page 0x0D, usage 0x47).
·
Width and height (page 0x0D, usages 0x48 and 0x49).
上面是报告描述符,
以下是我的解理,不知对不对,希望圈圈能指点指点。
上面报告描述符要发12字节给电脑。
我发给的数据为。
data[0]=0x21,data[1]=0x00,data[2]=0x00,data[3]=0x01,data[4]=0x00,data[5]=0x01,data[6]=0x10,data[7]=0x00,data[8]=0x10,data[9]=0x00,data[10]=0x00,data[11]=0x00,
第0个节字data[0],第0位为判断是否触摸位。我置1
第0个节字,每三位为IN Range位,判断是否有z轴。我置0。
第0个节字,每四位为信心位,判断对触摸的确定度,我置1。
第0个节字其它位为常数0。
每1个节字,data[1]。为常数位。我置0。
第2,3节字data[2]=0x00,data[3]=0x01。为X轴,坐标。
第4,5节字data[4]=0x00,data[5]=0x01。为Y轴,坐标。
第6,7节字data[6]=0x10,data[7]=0x00。为触摸宽度。
第8.,9节字data[8]=0x10,data[9]=0x00。为触摸高度。
第10.11节字data[10]=0x00,data[11]=0x00,为常数0
不知前上分细对不对?发送的数据对不对?
LM:逻辑大,LN:逻辑小,
PM:物理大,PN:物理小,
精度公式:(LM-LN)/(PM-PN)*10(的三次方)
还是怎么计算?
|