| Summary |
#include <rl_usb.h>
BOOL usbh_hid_mouse_getdata (
U8 ctrl,
U8 dev_idx,
U8* btn,
S8* x,
S8* y,
S8* wheel
);
|
| Description | The function usbh_hid_mouse_getdata retrieves the mouse data sent by an USB mouse. The argument ctrl is the index of USB Host Controller. The argument dev_idx is the index of device instance. The argument btn is a pointer to a data indicating the mouse buttons pressed. The arguments x and y are pointers to a data indicating relative location change of the mouse pointer. The argument wheel is a pointer to the mouse wheel data indicating the mouse wheel change. Implementing this function in user code overrides library function that handles boot protocol device mouse input. The usbh_hid_mouse_getdata function is part of the RL-USB Host Class Driver software layer. |
| Return Value | A boolean value indicating whether the mouse has been used. Value of __FALSE means that mouse did not have any new event to report. |
| See Also | usbh_hid_data_in, usbh_hid_data_in_callback, usbh_hid_data_out, usbh_hid_get_last_error, usbh_hid_kbd_getkey, usbh_hid_parse_report_desc, usbh_hid_status |
| Example |
#include <rl_usb.h>
void getmouse (void) {
..
if (usbh_hid_mouse_getdata (0, 0, &btn, &x, &y, &wheel)) { // If mouse moved
..
}
)
|