| Jum 
 
 
 Joined: 14 Jul 2004
 Posts: 6
 
 
 
			    
 
 | 
			
				| Problem sending ALT+B in ex_usb_kbmouse2 example code. |  
				|  Posted: Sun Oct 23, 2011 12:01 pm |   |  
				| 
 |  
				| I have a problem using the PIC18F2550 emulating a mouse and keyboard using USB HID. I'm using the 4.106 version of ccs and example ex_usb_kbmouse2.
 My problem is I'm not able to send special key combinations (alt, control, shift).
 
 If I try to send Alt + B does not work.
 
 The code is:
 
  	  | Code: |  	  | if (BUTTON_PRESSED())    {
 
 tx_msg[8]={2,0,0,0,0,0,0,0};
 tx_msg[1] = 4; //send press Alt?
 usb_put_packet(1,tx_msg,sizeof(tx_msg),USB_DTS_TOGGLE);
 delay_ms(50);
 
 tx_msg[3] = 5 // Send press B.
 usb_put_packet(1,tx_msg,sizeof(tx_msg),USB_DTS_TOGGLE);
 delay_ms(50);
 
 tx_msg[3] = 0 // send no key press.
 usb_put_packet(1,tx_msg,sizeof(tx_msg),USB_DTS_TOGGLE);
 delay_ms(50);
 
 tx_msg[1] = 4; //send no Alt press
 usb_put_packet(1,tx_msg,sizeof(tx_msg),USB_DTS_TOGGLE);
 delay_ms(50);
 
 delay_ms(500);
 }
 
 | 
 The rest of the code is the example ex_usb_kbmouse2.
 
 What is the correct way to send Alt +1?
 
 Some sample code?
 
 Thanks and sorry for my bad English.
 |  |