If I want to use Keil uVision to write a program to make the mouse to left click to have page_down function. How can I do? <Use Nordic nRf24LU1 two feature boards and the wireless mouse demo.>
HI! I am still trying to reach the page_down. But I wanna to do "shift the moue cilk function" first. namely,I do left clik it will do the "right-click" thing. Can you tach me? Thanks so much!
"If I want to use Keil uVision to write a program to make the mouse to left click to have page_down function. How can I do?" "HI! I am still trying to reach the page_down."
*** sigh *** Lack of imagination.
When the device gets "mouse click" event from the remote side, the device puts "page_down" keyboard report to USB. For other mouse events like move, the device puts usual mouse report to USB. In this way, just "mouse click" event is converted to "page_down".
It is the reason for above combined device of mouse and keyboard. This device can put both of mouse and keyboard report.
"But I wanna to do "shift the moue cilk function" first. namely,I do left clik it will do the "right-click" thing."
Just replace the relation between the input events and the USB outputs.
shift-click = - put shift-key down on keyboard report - put mouse click report - put shift-key up (ie. all 0) on keyboard report
Tsuneo
Hi! After i changed the code, something funny happend.If i move the wireless mouse, a string of charactors come out! And what more interesting is that some of my keyboard keys have chaged thire functions. When i press "F" the "search rpage "will come out. If I press "E" or "M" the page of "computer drives" come out! I cannot use my keyboard any more. So i chage back the code and restart my PC. The keyboard became normal again. here are the code i chaged, i donnot know why it will affect my keyboard on PC which is not wireless one. And why only move the mouse ""abc"things came out,why PAGEDOWN never affect? I am so confused...here are the code i have changed
switch(dev_type) { case WDP_MOUSE: // If mouse data if(length == APP_MOUSE_PL_LENGTH) { usb_send_packet ( &radio_data[APP_DATA], USB_EP_KEYBOARD, (APP_KEYBOARD_PL_LENGTH - APP_DATA) ); switch(radio_data[APP_MOUSE_BUTTONS]) { case 0x09:radio_data[APP_MOUSE_BUTTONS]=0x4E; default radio_data[APP_MOUSE_BUTTONS]=0; } } break;
the origianl code is
switch(dev_type) { case WDP_MOUSE: // If mouse data if(length == APP_MOUSE_PL_LENGTH) { usb_send_packet ( &radio_data[APP_DATA], USB_EP_MOUSE, (APP_MOUSE_PL_LENGTH - APP_DATA) ); } break; case WDP_KEYBOARD: // If keyboard data if(length == APP_KEYBOARD_PL_LENGTH) { usb_send_packet ( &radio_data[APP_DATA], USB_EP_KEYBOARD, (APP_KEYBOARD_PL_LENGTH - APP_DATA) ); } break; } }
You have to keep track of the state of all modifying buttons - left and right shift, shift, ctrl, alt, win, alt gr, ...