键盘报告数据#define KEY_NONE 0x00
#define KEY_UP 0x1A
#define KEY_DOWN 0x16
#define KEY_LEFT 0x04
#define KEY_RIGHT 0x07
#define KEY_A 0x18
#define KEY_B 0x0C
#define KEY_C 0x0D
#define KEY_D 0x0E
#define KEY_L_CTRL 0x01
#define KEY_L_SHIFT 0x02
#define KEY_L_ALT 0x04
#define KEY_L_WIN 0x08
#define KEY_R_CTRL 0x10
#define KEY_R_SHIFT 0x20
#define KEY_R_ALT 0x40
#define KEY_R_WIN 0x80
void keyBoard_value(char spcKey, char nomKey0, char nomKey1, char nomKey2,
char nomKey3, char nomKey4, char nomKey5)
{
write_mreg32(USB_EPn_FIFO(EPIN), spcKey); //功能键
write_mreg32(USB_EPn_FIFO(EPIN), 0x00); //保留
write_mreg32(USB_EPn_FIFO(EPIN), nomKey0); //常用按键键值,按键1为0x59 数字依次类推
write_mreg32(USB_EPn_FIFO(EPIN), nomKey1); //常用按键键值
write_mreg32(USB_EPn_FIFO(EPIN), nomKey2); //常用按键键值
write_mreg32(USB_EPn_FIFO(EPIN), nomKey3);
write_mreg32(USB_EPn_FIFO(EPIN), nomKey4);
write_mreg32(USB_EPn_FIFO(EPIN), nomKey5);
write_mreg32(USB_EPn_CTRL(EPIN), 0x88); //send 4 bytes packet
}
|