Subversion Repositories Kolibri OS

Rev

Rev 4529 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4529 Rev 4530
Line 116... Line 116...
116
end if
116
end if
117
.x:
117
.x:
118
; 3. This is x moving. For relative fields, store the value in the state.
118
; 3. This is x moving. For relative fields, store the value in the state.
119
; Pass absolute field to the default handler.
119
; Pass absolute field to the default handler.
120
        test    byte [esi+report_field_group.flags], HID_FIELD_RELATIVE
120
        test    byte [esi+report_field_group.flags], HID_FIELD_RELATIVE
121
        jz      .relative_x
121
        jz      .absolute_x
122
        mov     [edi+mouse_device_data.dx], edx
122
        mov     [edi+mouse_device_data.dx], edx
123
        ret
123
        ret
124
.y:
124
.y:
125
; 4. This is y moving. For relative fields, store the value in the state,
125
; 4. This is y moving. For relative fields, store the value in the state,
126
; changing the sign: HID uses "mathematics" scheme with Y axis increasing from
126
; changing the sign: HID uses "mathematics" scheme with Y axis increasing from
127
; bottom to top, the kernel expects "programming" PS/2-style with Y axis
127
; bottom to top, the kernel expects "programming" PS/2-style with Y axis
128
; increasing from top to bottom.
128
; increasing from top to bottom.
129
; Pass absolute fields to the default handler.
129
; Pass absolute fields to the default handler.
130
        test    byte [esi+report_field_group.flags], HID_FIELD_RELATIVE
130
        test    byte [esi+report_field_group.flags], HID_FIELD_RELATIVE
131
        jz      .relative_y
131
        jz      .absolute_y
132
        neg     edx
132
        neg     edx
133
        mov     [edi+mouse_device_data.dy], edx
133
        mov     [edi+mouse_device_data.dy], edx
134
        ret
134
        ret
135
.wheel:
135
.wheel:
136
; 5. This is wheel event. For relative fields, store the value in the state,
136
; 5. This is wheel event. For relative fields, store the value in the state,
Line 143... Line 143...
143
.hwheel:
143
.hwheel:
144
        test    byte [esi+report_field_group.flags], HID_FIELD_RELATIVE
144
        test    byte [esi+report_field_group.flags], HID_FIELD_RELATIVE
145
        jz      .unclaimed
145
        jz      .unclaimed
146
        mov     [edi+mouse_device_data.hwheel], edx
146
        mov     [edi+mouse_device_data.hwheel], edx
147
        ret
147
        ret
148
.relative_x:
148
.absolute_x:
149
        push    ebx
149
        push    ebx
150
        mov     eax, [screen_x]
150
        mov     eax, [screen_x]
151
        mul     edx
151
        mul     edx
152
        mov     ebx, 0x8000
152
        mov     ebx, 0x8000
153
        div     ebx
153
        div     ebx
154
        mov     [edi+mouse_device_data.dx], eax
154
        mov     [edi+mouse_device_data.dx], eax
155
        or      [edi+mouse_device_data.buttons], 0x80000000
155
        or      [edi+mouse_device_data.buttons], 0x80000000
156
        pop     ebx
156
        pop     ebx
157
        ret
157
        ret
158
.relative_y:
158
.absolute_y:
159
        push    ebx
159
        push    ebx
160
        mov     eax, [screen_y]
160
        mov     eax, [screen_y]
161
        mul     edx
161
        mul     edx
162
        mov     ebx, 0x8000
162
        mov     ebx, 0x8000
163
        div     ebx
163
        div     ebx