Difference between revisions of "MOUSEWHEEL"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 7: Line 7:
  
 
{{PageDescription}}
 
{{PageDescription}}
* Positive return value of 1 represents one "click" the mouse wheel was moved toward user.
+
* Positive return value of 1 represents one "click" the mouse wheel was moved away from the user.
* Negative return value of -1 represents one "click" the mouse wheel was moved away from user.
+
* Negative return value of -1 represents one "click" the mouse wheel was moved toward the user.
 
* After a "click" has been read, the value resets to 0 automatically.
 
* After a "click" has been read, the value resets to 0 automatically.
 
* If no movement on the wheel has occurred since the last {{KW|_MOUSEINPUT}} read, _MOUSEWHEEL returns 0.
 
* If no movement on the wheel has occurred since the last {{KW|_MOUSEINPUT}} read, _MOUSEWHEEL returns 0.

Revision as of 09:40, 25 March 2010

The _MOUSEWHEEL function returns a positive or negative INTEGER value indicating the mouse scroll wheel clicks since the last mouse read.


Syntax

scroll% = _MOUSEWHEEL


Description

  • Positive return value of 1 represents one "click" the mouse wheel was moved away from the user.
  • Negative return value of -1 represents one "click" the mouse wheel was moved toward the user.
  • After a "click" has been read, the value resets to 0 automatically.
  • If no movement on the wheel has occurred since the last _MOUSEINPUT read, _MOUSEWHEEL returns 0.
  • You may want to use a cumulative mouse wheel scroll value using a total variable.


Example: Reading the cumulative mouse wheel "clicks" (Enter quits).

DO: K$ = INKEY$ DO WHILE _MOUSEINPUT Scroll = Scroll + _MOUSEWHEEL LOCATE 10, 20: PRINT Scroll LOOP LOOP UNTIL K$ = CHR$(13)



See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page