Rev 3711 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3711 | Rev 3741 | ||
---|---|---|---|
Line 23... | Line 23... | ||
23 | struct mouse_device_data |
23 | struct mouse_device_data |
24 | buttons dd ? ; buttons that are currently pressed |
24 | buttons dd ? ; buttons that are currently pressed |
25 | dx dd ? ; current x moving |
25 | dx dd ? ; current x moving |
26 | dy dd ? ; current y moving |
26 | dy dd ? ; current y moving |
27 | wheel dd ? ; current wheel moving |
27 | wheel dd ? ; current wheel moving |
- | 28 | hwheel dd ? |
|
28 | ends |
29 | ends |
Line 29... | Line 30... | ||
29 | 30 | ||
30 | ; This procedure is called when HID layer detects a new mouse. |
31 | ; This procedure is called when HID layer detects a new mouse. |
31 | ; in: ebx -> device_data from USB layer, edi -> collection |
32 | ; in: ebx -> device_data from USB layer, edi -> collection |
Line 54... | Line 55... | ||
54 | ; Zero all variables describing the current state. |
55 | ; Zero all variables describing the current state. |
55 | mov [edi+mouse_device_data.buttons], 0 |
56 | mov [edi+mouse_device_data.buttons], 0 |
56 | mov [edi+mouse_device_data.dx], 0 |
57 | mov [edi+mouse_device_data.dx], 0 |
57 | mov [edi+mouse_device_data.dy], 0 |
58 | mov [edi+mouse_device_data.dy], 0 |
58 | mov [edi+mouse_device_data.wheel], 0 |
59 | mov [edi+mouse_device_data.wheel], 0 |
- | 60 | mov [edi+mouse_device_data.hwheel], 0 |
|
59 | ret |
61 | ret |
60 | endp |
62 | endp |
Line 61... | Line 63... | ||
61 | 63 | ||
62 | ; This procedure is called when HID layer processes every non-empty array field group. |
64 | ; This procedure is called when HID layer processes every non-empty array field group. |
Line 81... | Line 83... | ||
81 | jz .x |
83 | jz .x |
82 | cmp ecx, USAGE_GD_Y |
84 | cmp ecx, USAGE_GD_Y |
83 | jz .y |
85 | jz .y |
84 | cmp ecx, USAGE_GD_WHEEL |
86 | cmp ecx, USAGE_GD_WHEEL |
85 | jz .wheel |
87 | jz .wheel |
- | 88 | cmp ecx, 0xC0238 |
|
- | 89 | jz .hwheel |
|
86 | sub ecx, USAGE_BUTTON_PAGE + 1 |
90 | sub ecx, USAGE_BUTTON_PAGE + 1 |
87 | jb .unclaimed |
91 | jb .unclaimed |
88 | cmp ecx, 32 |
92 | cmp ecx, 32 |
89 | jae .unclaimed |
93 | jae .unclaimed |
90 | ; 2. This is a button. |
94 | ; 2. This is a button. |
Line 127... | Line 131... | ||
127 | test byte [esi+report_field_group.flags], HID_FIELD_RELATIVE |
131 | test byte [esi+report_field_group.flags], HID_FIELD_RELATIVE |
128 | jz .unclaimed |
132 | jz .unclaimed |
129 | neg edx |
133 | neg edx |
130 | mov [edi+mouse_device_data.wheel], edx |
134 | mov [edi+mouse_device_data.wheel], edx |
131 | ret |
135 | ret |
- | 136 | .hwheel: |
|
- | 137 | test byte [esi+report_field_group.flags], HID_FIELD_RELATIVE |
|
- | 138 | jz .unclaimed |
|
- | 139 | mov [edi+mouse_device_data.hwheel], edx |
|
- | 140 | ret |
|
132 | endp |
141 | endp |
Line 133... | Line 142... | ||
133 | 142 | ||
134 | ; This procedure is called when HID layer ends processing a new input packet |
143 | ; This procedure is called when HID layer ends processing a new input packet |
135 | ; from a mouse. |
144 | ; from a mouse. |
Line 139... | Line 148... | ||
139 | stdcall SetMouseData, \ |
148 | stdcall SetMouseData, \ |
140 | [edi+mouse_device_data.buttons], \ |
149 | [edi+mouse_device_data.buttons], \ |
141 | [edi+mouse_device_data.dx], \ |
150 | [edi+mouse_device_data.dx], \ |
142 | [edi+mouse_device_data.dy], \ |
151 | [edi+mouse_device_data.dy], \ |
143 | [edi+mouse_device_data.wheel], \ |
152 | [edi+mouse_device_data.wheel], \ |
144 | 0 |
153 | [edi+mouse_device_data.hwheel] |
145 | ret |
154 | ret |
146 | endp |
155 | endp |