多点触摸 终于有了初步成果
来源:互联网 发布:本地网络电缆被拔出 编辑:程序博客网 时间:2024/05/15 10:09
经过半个月,查资料,写程序,今天终于有了点成绩。
之前不管怎么修改报文描述符,在WIN7都无法识别触点,觉得可能自己的工程没有对feature报文做处理,导致无法识别。后来查看了F321的资料,发现有个BLINK的例子可以模仿,看过之后,发现它做了feature的处理,修改后,发现终于识别了触点信息了,光标变成了触点,但是奇观的是无法移动图片,让其放大缩小,后来下载了Surface Globe,发现自己模拟的手势消息可以让地球放大缩小,奇了怪了,不过总算是个进步,相信会能够成功的,接下来就是完善多点触摸的报文描述符了,添加单点的支持。
描述符:
code const device_descriptor DEVICEDESC =
{
18, // bLength
0x01, // bDescriptorType
0x1001, // bcdUSB
0x00, // bDeviceClass
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
EP0_PACKET_SIZE, // bMaxPacketSize0
0xfc03, // idVendor
0xd905, // idProduct
0x0002, // bcdDevice
0x00, // iManufacturer
0x00, // iProduct
0x01, // iSerialNumber
0x01 // bNumConfigurations
}; //end of DEVICEDESC
// From "USB Device Class Definition for Human Interface Devices (HID)".
// Section 7.1:
// "When a Get_Descriptor(Configuration) request is issued,
// it returns the Configuration descriptor, all Interface descriptors,
// all Endpoint descriptors, and the HID descriptor for each interface."
code const hid_configuration_descriptor HIDCONFIGDESC =
{
{ // configuration_descriptor hid_configuration_descriptor
0x09, // Length
0x02, // Type
0x2900, // Totallength (= 9+9+9+7+7)
0x01, // NumInterfaces
0x01, // bConfigurationValue
0x00, // iConfiguration
0x80, // bmAttributes
0x20 // MaxPower (in 2mA units)
},
{ // interface_descriptor hid_interface_descriptor
0x09, // bLength
0x04, // bDescriptorType
0x00, // bInterfaceNumber
0x00, // bAlternateSetting
0x02, // bNumEndpoints
0x03, // bInterfaceClass (3 = HID)
0x00, // bInterfaceSubClass
0x00, // bInterfaceProcotol
0x00 // iInterface
},
{ // class_descriptor hid_descriptor
0x09, // bLength
0x21, // bDescriptorType
0x0101, // bcdHID
0x00, // bCountryCode
0x02, // bNumDescriptors
0x22, // bDescriptorType
HID_REPORT_DESCRIPTOR_SIZE_LE // wItemLength (tot. len. of report
// descriptor)
},
// IN endpoint (mandatory for HID)
{ // endpoint_descriptor hid_endpoint_in_descriptor
0x07, // bLength
0x05, // bDescriptorType
0x81, // bEndpointAddress
0x03, // bmAttributes
EP1_PACKET_SIZE_LE, // MaxPacketSize (LITTLE ENDIAN)
10 // bInterval
},
// OUT endpoint (optional for HID)
{ // endpoint_descriptor hid_endpoint_out_descriptor
0x07, // bLength
0x05, // bDescriptorType
0x01, // bEndpointAddress
0x03, // bmAttributes
EP2_PACKET_SIZE_LE, // MaxPacketSize (LITTLE ENDIAN)
10 // bInterval
}
};
code const hid_report_descriptor HIDREPORTDESC =
{
//multitouch descriptor length=157
0x05, 0x0d, // USAGE_PAGE (Digitizers)
0x09, 0x04, // USAGE (Touch Screen)
0xa1, 0x01, // COLLECTION (Application)
0x85, REPORTID_MTOUCH, // REPORT_ID (Touch)
0x09, 0x22, // USAGE (Finger)
0xa1, 0x02, // COLLECTION (Logical)
0x09, 0x42, // USAGE (Tip Switch)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x32, // USAGE (In Range)
0x81, 0x02, // INPUT (Data,Var,Abs)
// 0x09, 0x47, // USAGE (Touch Valid)
//0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x06, // REPORT_COUNT (5)
0x81, 0x03, // INPUT (Cnst,Ary,Abs)
0x75, 0x08, // REPORT_SIZE (8)
0x09, 0x51, // USAGE (Contact Identifier)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desk..
0x26, 0xff, 0x0f, // LOGICAL_MAXIMUM (4095)
0x75, 0x10, // REPORT_SIZE (16)
0x55, 0x00, // UNIT_EXPONENT (0)
0x65, 0x00, // UNIT (None)
0x09, 0x30, // USAGE (X)
0x35, 0x00, // PHYSICAL_MINIMUM (0)
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x31, // USAGE (Y)
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION
0xa1, 0x02, // COLLECTION (Logical)
0x05, 0x0d, // USAGE_PAGE (Digitizers)
0x09, 0x42, // USAGE (Tip Switch)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x32, // USAGE (In Range)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x47, // USAGE (Touch Valid)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x05, // REPORT_COUNT (5)
0x81, 0x03, // INPUT (Cnst,Ary,Abs)
0x75, 0x08, // REPORT_SIZE (8)
0x09, 0x51, // USAGE ( Cotact Identifier)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desk..
0x26, 0xff, 0x0f, // LOGICAL_MAXIMUM (4095)
0x75, 0x10, // REPORT_SIZE (16)
0x55, 0x00, // UNIT_EXPONENT (0)
0x65, 0x00, // UNIT (None)
0x09, 0x30, // USAGE (X)
0x35, 0x00, // PHYSICAL_MINIMUM (0)
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x31, // USAGE (Y)
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION
0x05, 0x0d, // USAGE_PAGE (Digitizers)
0x09, 0x54, // USAGE (Contact Count)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x08, // REPORT_SIZE (8)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x08, // LOGICAL_MAXIMUM (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x85, REPORTID_MAXIMUM, // REPORT_ID (maximum)
0x09, 0x55, // USAGE(Contact Count Maximum)
0xb1, 0x02, // FEATURE (Data,Var,Abs)
0xc0, // END_COLLECTION
//feature report 26
0x09, 0x0E, // USAGE (Device Configuration)
0xa1, 0x01, // COLLECTION (Application)
0x85, REPORTID_FEATURE, // REPORT_ID (Configuration)
0x09, 0x23, // USAGE (Device Settings)
0xa1, 0x02, // COLLECTION (logical)
0x09, 0x52, // USAGE (Device Mode)
0x09, 0x53, // USAGE (Device Identifier)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x0a, // LOGICAL_MAXIMUM (10)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (2)
0xb1, 0x02, // FEATURE (Data,Var,Abs
0xc0, // END_COLLECTION
0xc0, // END_COLLECTION
};
- 多点触摸 终于有了初步成果
- 多点触摸
- 多点触摸
- 多点触摸
- 多点触摸
- 多点触摸
- 终于对SEO有了初步的概念了
- 自己开发的“万能数据库查询分析器”终于有了较大的成果
- Cocos2d触摸:多点触摸
- Android-单点触摸-多点触摸
- 什么是多点触摸?
- 多点触摸技术
- 多点触摸技术
- Linux 多点触摸简介
- WPF4 多点触摸事件
- 多点触摸参考程序
- 多点触摸入门心得
- Andrioid 多点触摸
- java collection 知识点 以及在测试中的应用【待学习】
- 了解Global.asax 文件
- Match和Pattern类
- c#实现RSA加密解密
- MFC怎样编写后台运行的程序 (这个值得一看)
- 多点触摸 终于有了初步成果
- 如何在JSP页面中通过一个按钮,在对话框中选择一个目录而不是选择一个文件;input type=file只能选择一个文件,我想选择一个目录;做不出来项目经理要扣奖金的...............
- C语言二进制文件读写程序实现(基础)
- oracle 游标简单的总结
- 改造Lua的debug.traceback(),让其显示栈上所有的局部变量
- Struts2 <s:property /> 标签用法
- Flex 预载界面美化
- 自己的问题记录
- android控件与常用控件