Assembly code snippets

Back to the snippets overview

Details

TitleUsing the MouseWheel
AuthorNaN
Submitted by:NaN
Date added:2002-05-04 05:18:41
Date modified:2002-05-04 05:19:15

Comments

The value of EDX produced in either case is the # of whell "clicks" that happened. The each case is the direction the wheel was spun. The highest i was able to reach was 5 in one message :)

Snippet

IF uMsg == WM_MOUSEWHEEL
     mov edx, wParam
     sar edx, 16
     .if( SDWORD PTR edx > 0)
       ; PrintText "Move Positive Wheel (Wheel UP)"
       shr edx, 3
       neg edx
       and edx, 0fh
       ; PrintDec edx

       ; USE EDX HERE!

     .else
       ; PrintText "Move Negative Wheel (Wheel DOwn)"
       shr edx, 3
       and edx, 0fh
       ; PrintDec edx

       ; USE EDX HERE!

     .endif