mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-12 09:57:05 +03:00
ffd240bc4f
git-svn-id: svn://kolibrios.org@4813 a494cfbc-eb01-0410-851d-a64ba20cac60
31 lines
1.2 KiB
PHP
31 lines
1.2 KiB
PHP
mouse_local:
|
|
;.................................................................................................
|
|
; Ïîëó÷àåì êîîðäèíàòû ìûøè îòíîñèòåëüíî îêíà
|
|
;.................................................................................................
|
|
mov eax,37 ; Ôóíêöèÿ 37 - ðàáîòà ñ ìûøüþ
|
|
mov ebx,1 ; íàì íóæíû ãëîáàëüíûå êîîðäèíàòû
|
|
int 0x40 ; eax = x*65536 + y, (x,y)=êîîðäèíàòû êóðñîðà ìûøè
|
|
mov ecx,eax ;
|
|
shr ecx,16 ; ecx = x+1
|
|
movzx edx,ax ; edx = y+1
|
|
dec ecx ; ecx = x
|
|
dec edx ; edx = y
|
|
mov [mouse_x],ecx ; mouse_x = x
|
|
mov [mouse_y],edx ; mouse_y = y
|
|
ret ; Âîçâðàùàåì óïðàâëåíèå
|
|
;end_mouse_local
|
|
|
|
mouse_left:
|
|
pusha
|
|
xor ecx,ecx
|
|
mov eax,37
|
|
mov ebx,2
|
|
int 0x40
|
|
cmp al,1
|
|
jne @f
|
|
mov ecx,1
|
|
@@:
|
|
mov [mouse_l],ecx
|
|
popa
|
|
ret
|
|
;end |