您现在的位置: USB开发网 > USB技术文档 > USB HID设备类
- USB HID设备类

WIN7触摸屏的报告描述符

------分隔线----------------------------

废话不多说,直接上代码:

  1. 0x05, 0x0d,                         // USAGE_PAGE (Digitizers)          0 
  2.     0x09, 0x04,                         // USAGE (Touch Screen)             2 
  3.     0xa1, 0x01,                         // COLLECTION (Application)         4 
  4.     0x85, 0xaa,                          //   REPORT_ID (Touch)              6 
  5.     0x09, 0x20,                         //   USAGE (Stylus)                 8 
  6.     0xa1, 0x00,                         //   COLLECTION (Physical)          10 
  7.     0x09, 0x42,                         //     USAGE (Tip Switch)           12 
  8.     0x15, 0x00,                         //     LOGICAL_MINIMUM (0)          14 
  9.     0x25, 0x01,                         //     LOGICAL_MAXIMUM (1)          16 
  10.     0x75, 0x01,                         //     REPORT_SIZE (1)              18 
  11.     0x95, 0x01,                         //     REPORT_COUNT (1)             20 
  12.     0x81, 0x02,                         //     INPUT (Data,Var,Abs)         22 
  13.     0x95, 0x03,                         //     REPORT_COUNT (3)             24 
  14.     0x81, 0x03,                         //     INPUT (Cnst,Ary,Abs)         26 
  15.     0x09, 0x32,                         //     USAGE (In Range)             28 
  16.     0x09, 0x37,                         //     USAGE (Data Valid-Finger)    30 
  17.     0x95, 0x02,                         //     REPORT_COUNT (2)             32 
  18.     0x81, 0x02,                         //     INPUT (Data,Var,Abs)         34 
  19.     0x95, 0x0a,                         //     REPORT_COUNT (10)            36 
  20.     0x81, 0x03,                         //     INPUT (Cnst,Ary,Abs)         38 
  21.     0x05, 0x01,                         //     USAGE_PAGE (Generic Desktop) 40 
  22.     0x26, 0xff, 0x7f,                   //     LOGICAL_MAXIMUM (32767)      42 
  23.     0x75, 0x10,                         //     REPORT_SIZE (16)             45 
  24.     0x95, 0x01,                         //     REPORT_COUNT (1)             47 
  25.     0xa4,                               //     PUSH                         49 
  26.     0x55, 0x0d,                         //     UNIT_EXPONENT (-3)           50 
  27.     0x65, 0x00,                         //     UNIT (None)                  52 
  28.     0x09, 0x30,                         //     USAGE (X)                    54 
  29.     0x35, 0x00,                         //     PHYSICAL_MINIMUM (0)         56 
  30.     0x46, 0x00, 0x00,                   //     PHYSICAL_MAXIMUM (0)         58 
  31.     0x81, 0x02,                         //     INPUT (Data,Var,Abs)         61 
  32.     0x09, 0x31,                         //     USAGE (Y)                    63 
  33.     0x46, 0x00, 0x00,                   //     PHYSICAL_MAXIMUM (0)         65 
  34.     0x81, 0x02,                         //     INPUT (Data,Var,Abs)         68 
  35.     0xb4,                               //     POP                          70 
  36.     0x05, 0x0d,                         //     USAGE PAGE (Digitizers)      71 
  37.     0x09, 0x60,                         //     USAGE (Width)                73 
  38.     0x09, 0x61,                         //     USAGE (Height)               75 
  39.     0x95, 0x02,                         //     REPORT_COUNT (2)             77 
  40.     0x81, 0x02,                         //     INPUT (Data,Var,Abs)         79 
  41.     0x95, 0x01,                         //     REPORT_COUNT (1)             81 
  42.     0x81, 0x03,                         //     INPUT (Cnst,Ary,Abs)         83/85 
  43.     0xc0,                               //   END_COLLECTION                 0/1 
  44.  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(的三次方)

还是怎么计算?

------分隔线----------------------------
联系我们
  • Q Q: 1148374829 点击这里给我发消息
  • 旺旺:jhoneqhsieh 点击这里给我发消息
  • 电话:(0)15923141204
  • 淘宝网店
USB开源项目