CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problem sending ALT+B in ex_usb_kbmouse2 example code.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jum



Joined: 14 Jul 2004
Posts: 6

View user's profile Send private message

Problem sending ALT+B in ex_usb_kbmouse2 example code.
PostPosted: Sun Oct 23, 2011 12:01 pm     Reply with quote

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.
fkl



Joined: 20 Nov 2010
Posts: 44

View user's profile Send private message

re
PostPosted: Sun Oct 23, 2011 12:38 pm     Reply with quote

Hello.
I too am trying to find out 'emulating keyboard"
Can you put the code of the program?

ps
sorry for my english
Jum



Joined: 14 Jul 2004
Posts: 6

View user's profile Send private message

PostPosted: Sun Oct 23, 2011 4:08 pm     Reply with quote

The code is in examples ccs. The code is called ex_usb_kbmouse2
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group