void Generate_usb_code(unsigned char *tx_buf,unsigned long int* scan_code)
{
//根据扫描码生成usb码
//填充usb数据表
unsigned char usb,i;
unsigned long tmp;
for(i=0;i<8;i++)
{
tmp=scan_code[1+i];
switch(tmp)
{ //usb
case 0xfffeff: usb=0xE3; break; // L GUI
case 0xfffefe: usb=0xE4; break; // R ctrl
case 0xfffefd: usb=0xE7; break; // R GUI
case 0xfffefb: usb=0xE6; break; // R ALT
case 0xfffef7: usb=0x65; break; // APP
case 0xfffeef: usb=0x49; break; // Keyboard insert
case 0xfffedf: usb=0x4A; break; // Keyboard home
case 0xfffebf: usb=0x4B; break; // Keyboard page up
case 0x00007f: usb=0x4C; break; // Keyboard delete
default: usb=0;
}
tx_buf[i]=usb;
}
}