1
10
13
14
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
100
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
142
146
147
148
149
150
151
...
...
...
#define UX_SOURCE_CODE
#include "ux_api.h"
#include "ux_host_class_hid.h"
#include "ux_host_class_hid_mouse.h"
#include "ux_host_stack.h"
...
...
VOID _ux_host_class_hid_mouse_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback)
{
UX_HOST_CLASS_HID_CLIENT *hid_client;
UX_HOST_CLASS_HID_MOUSE *mouse_instance;
hid_client = callback -> ux_host_class_hid_report_callback_client;
mouse_instance = (UX_HOST_CLASS_HID_MOUSE *) hid_client -> ux_host_class_hid_client_local_instance;
switch (callback -> ux_host_class_hid_report_callback_usage)
{
case UX_HOST_CLASS_HID_MOUSE_AXIS_X :
mouse_instance -> ux_host_class_hid_mouse_x_position += (SCHAR) callback -> ux_host_class_hid_report_callback_value;
break;
case UX_HOST_CLASS_HID_MOUSE_AXIS_X :
case UX_HOST_CLASS_HID_MOUSE_AXIS_Y :
mouse_instance -> ux_host_class_hid_mouse_y_position += (SCHAR) callback -> ux_host_class_hid_report_callback_value;
break;
case UX_HOST_CLASS_HID_MOUSE_AXIS_Y :
case UX_HOST_CLASS_HID_MOUSE_BUTTON_1 :
if (callback -> ux_host_class_hid_report_callback_value == UX_TRUE)
mouse_instance -> ux_host_class_hid_mouse_buttons |= UX_HOST_CLASS_HID_MOUSE_BUTTON_1_PRESSED;
else
mouse_instance -> ux_host_class_hid_mouse_buttons &= (ULONG)~UX_HOST_CLASS_HID_MOUSE_BUTTON_1_PRESSED;
break;
case UX_HOST_CLASS_HID_MOUSE_BUTTON_1 :
case UX_HOST_CLASS_HID_MOUSE_BUTTON_2 :
if (callback -> ux_host_class_hid_report_callback_value == UX_TRUE)
mouse_instance -> ux_host_class_hid_mouse_buttons |= UX_HOST_CLASS_HID_MOUSE_BUTTON_2_PRESSED;
else
mouse_instance -> ux_host_class_hid_mouse_buttons &= (ULONG)~UX_HOST_CLASS_HID_MOUSE_BUTTON_2_PRESSED;
break;
case UX_HOST_CLASS_HID_MOUSE_BUTTON_2 :
case UX_HOST_CLASS_HID_MOUSE_BUTTON_3 :
if (callback -> ux_host_class_hid_report_callback_value == UX_TRUE)
mouse_instance -> ux_host_class_hid_mouse_buttons |= UX_HOST_CLASS_HID_MOUSE_BUTTON_3_PRESSED;
else
mouse_instance -> ux_host_class_hid_mouse_buttons &= (ULONG)~UX_HOST_CLASS_HID_MOUSE_BUTTON_3_PRESSED;
break;
case UX_HOST_CLASS_HID_MOUSE_BUTTON_3 :
case UX_HOST_CLASS_HID_MOUSE_WHEEL :
mouse_instance -> ux_host_class_hid_mouse_wheel += (SCHAR) callback -> ux_host_class_hid_report_callback_value;
break;
case UX_HOST_CLASS_HID_MOUSE_WHEEL :
default :
break;default
}switch (callback -> ux_host_class_hid_report_callback_usage) { ... }
return;
}{ ... }