usb 键盘模拟

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

usb 键盘模拟

2,321 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by free_soul on Sun Jan 13 21:31:35 CST 2013
用lpc模拟 usb hid 键盘,想一次输入64个键值,试验中如果两个相邻的键值不一样,在记事本中就能打印出来,但如果相邻的几个键值是一样的记事本显示的这个键值可能就显示的比定义的少。求这个问题怎么解决
Labels (1)
0 Kudos
Reply
4 Replies

2,081 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by free_soul on Tue Jan 15 02:50:38 CST 2013
在BUS HOUND里抓的数据来看 数据并没丢失,不知道操作系统是怎么处理一起发送的按键的,要不要来个延时什么的,但是我试过延时好像也没用。
0x05, 0x01, // USAGE_PAGE (Generic Desktop)

0x09, 0x06, // USAGE (Keyboard)


0xa1, 0x01, // COLLECTION (Application)

0x95, 0x40, // REPORT_COUNT (64)

0x75, 0x08, // REPORT_SIZE (8)

0x15, 0x00, // LOGICAL_MINIMUM (0)

0x25, 0xFF, // LOGICAL_MAXIMUM (255)

0x05, 0x07, // USAGE_PAGE (Keyboard)

0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))

0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)

0x81, 0x00, // INPUT (Data,Ary,Abs)
上面是定义的报告描述符,难道有问题? 和其他描述符有关?
0 Kudos
Reply

2,081 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by G1 on Tue Jan 15 01:51:06 CST 2013
这个不像是因为相邻的数据一样才丢,倒像是程序没来得及发出数据来。可有程序?
0 Kudos
Reply

2,081 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by free_soul on Mon Jan 14 19:39:33 CST 2013
对的 数据会丢失 比如定义一个按键值组{0x04,0x05,0x06,0x07}(键值参考HID Usage Tables) 就会在记事本上正常的输入 a b c d,但如果定义成{0x04,0x04,0x06,0x07}就有可能不输入成 a a c d 而输入成 a c d
0 Kudos
Reply

2,081 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by G1 on Mon Jan 14 01:28:56 CST 2013
这个问题挺有趣的,但是能不能够详细一些呢?连着按两个按键,其对应的键值相同,会导致传输上去的数据丢失么?
0 Kudos
Reply