Subversion Repositories Kolibri OS

Rev

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

Rev 5986 Rev 6230
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 5986 $
8
$Revision: 6230 $
9
 
9
 
10
 
10
 
Line 33... Line 33...
33
endg
33
endg
Line 34... Line 34...
34
 
34
 
35
iglobal
35
iglobal
36
;--------------------------------------
36
;--------------------------------------
37
align 4
37
align 4
38
mouse_speed_factor      dw 1
38
mouse_speed_factor      dw 4
39
mouse_delay             db 1
39
mouse_delay             db 3
40
mouse_doubleclick_delay db 64
40
mouse_doubleclick_delay db 64
Line 41... Line 41...
41
endg
41
endg
Line 478... Line 478...
478
        ret
478
        ret
Line 479... Line 479...
479
 
479
 
Line 480... Line 480...
480
;-----------------------------------------------------------------------------
480
;-----------------------------------------------------------------------------
481
 
481
 
Line 482... Line 482...
482
align 4
482
align 4
483
proc set_mouse_data stdcall uses edx, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword
483
proc set_mouse_data stdcall uses ecx edx, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword
484
 
484
 
485
        mov     eax, [BtnState]
485
        mov     eax, [BtnState]
Line 549... Line 549...
549
        call    wakeup_osloop
549
        call    wakeup_osloop
550
        ret
550
        ret
551
endp
551
endp
Line 552... Line 552...
552
 
552
 
553
;-----------------------------------------------------------------------------
-
 
554
; 3 = (x+1)^2 /4
-
 
555
; 2 = (x+2)^2 /8
-
 
556
; 1 = (x+3)^2 /16
-
 
557
align 4
553
;-----------------------------------------------------------------------------
558
mouse_acceleration:
-
 
559
        cmp     [mouse_delay], 0
-
 
560
        jz      .end
-
 
561
        push    eax
-
 
562
@@:
554
mouse_acceleration:
563
        neg     eax
-
 
564
        jl      @b
-
 
565
        inc     eax
555
        neg     ax
566
        cmp     [mouse_delay], 3
-
 
567
        adc     eax, 0
556
        jl      mouse_acceleration
568
        cmp     [mouse_delay], 2
-
 
569
        adc     eax, 0
557
        add     al, [mouse_delay]
570
        mul     al
-
 
571
        shr     eax, 2
558
        mul     al
572
        cmp     [mouse_delay], 2
-
 
573
        jz      .2
559
        mov     cx, [mouse_speed_factor]
574
        jnc     .3
-
 
575
        shr     eax, 1
-
 
576
.2:
560
        dec     ax
577
        shr     eax, 1
-
 
578
.3:
561
        shr     ax, cl
579
        pop     edx
562
        inc     ax
580
        test    edx, edx
563
        test    eax, eax
581
        jns     .end
564
        jns     @f
582
        neg     eax
565
        neg     ax
583
.end:
-
 
584
        imul    [mouse_speed_factor]
566
@@: