forked from KolibriOS/kolibrios
More reliable third button.
git-svn-id: svn://kolibrios.org@5076 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
455fe89163
commit
4afcb5706b
@ -139,7 +139,7 @@ proc init_mouse stdcall port, irq
|
|||||||
; Disable power and mouse interrupts
|
; Disable power and mouse interrupts
|
||||||
mov dx, bx
|
mov dx, bx
|
||||||
add dx, 4 ; modem control register
|
add dx, 4 ; modem control register
|
||||||
mov al, 0 ; reset DTR, RTS, and OUT2
|
mov al, 0 ; reset DTR, RTS, and AUX2
|
||||||
out dx, al
|
out dx, al
|
||||||
|
|
||||||
; Wait 5 ticks (0.2s)
|
; Wait 5 ticks (0.2s)
|
||||||
@ -158,9 +158,9 @@ proc init_mouse stdcall port, irq
|
|||||||
mov dx, bx
|
mov dx, bx
|
||||||
in al, dx
|
in al, dx
|
||||||
|
|
||||||
; set DTR, DTS and OUT2
|
; Power on the mouse
|
||||||
add dx, 4
|
add dx, 4
|
||||||
mov al, 1011b
|
mov al, 1011b ; set DTR, DTS and AUX2
|
||||||
out dx, al
|
out dx, al
|
||||||
|
|
||||||
mov ecx, 0x1FFFF
|
mov ecx, 0x1FFFF
|
||||||
@ -279,12 +279,12 @@ irq_handler:
|
|||||||
mov al, [esi + com_mouse_data.data+0]
|
mov al, [esi + com_mouse_data.data+0]
|
||||||
mov ah, al
|
mov ah, al
|
||||||
shr al, 3 ; right mouse button
|
shr al, 3 ; right mouse button
|
||||||
and al, 2 ;
|
and al, 10b ;
|
||||||
shr ah, 5 ; left mouse button
|
shr ah, 5 ; left mouse button
|
||||||
and ah, 1 ;
|
and ah, 1b ;
|
||||||
add al, ah
|
or al, ah
|
||||||
movzx eax, al
|
and [BTN_DOWN], not 11b
|
||||||
mov [BTN_DOWN], eax
|
or byte[BTN_DOWN], al
|
||||||
|
|
||||||
; X coordinate
|
; X coordinate
|
||||||
mov al, [esi + com_mouse_data.data+0]
|
mov al, [esi + com_mouse_data.data+0]
|
||||||
@ -309,12 +309,16 @@ irq_handler:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.FourthByte:
|
.FourthByte:
|
||||||
|
cmp [esi + com_mouse_data.offset], 2
|
||||||
|
jne .end
|
||||||
inc [esi + com_mouse_data.offset]
|
inc [esi + com_mouse_data.offset]
|
||||||
|
|
||||||
|
and [BTN_DOWN], not 100b
|
||||||
test al, 00100000b
|
test al, 00100000b
|
||||||
jz .end
|
jz @f
|
||||||
or [BTN_DOWN], 100b
|
or byte[BTN_DOWN], 100b
|
||||||
invoke SetMouseData, [BTN_DOWN], [MOUSE_X], [MOUSE_Y], 0, 0
|
@@:
|
||||||
|
invoke SetMouseData, [BTN_DOWN], 0, 0, 0, 0
|
||||||
|
|
||||||
.end:
|
.end:
|
||||||
pop esi
|
pop esi
|
||||||
|
Loading…
Reference in New Issue
Block a user