Difference between revisions of "MOUSEWHEEL"

From QB64 Wiki
Jump to navigation Jump to search
imported>Cyperium
imported>Clippy
(example)
Line 10: Line 10:
 
* Negative values represent how many "clicks" the mouse wheel has been moved up.
 
* Negative values represent how many "clicks" the mouse wheel has been moved up.
 
* Return values are relative to the last time {{KW|_MOUSEINPUT}} was used, so if no movement on the wheel has occurred since the last read, _MOUSEWHEEL returns 0.
 
* Return values are relative to the last time {{KW|_MOUSEINPUT}} was used, so if no movement on the wheel has occurred since the last read, _MOUSEWHEEL returns 0.
 +
* You may want to use a cumulative mouse wheel click value.
  
 +
 +
''Example:'' Reading the cumulative mouse wheel clicks (enter quits).
 +
 +
{{CodeStart}}
 +
DO: K$ = INKEY$
 +
    DO WHILE {{Cl|_MOUSEINPUT}}
 +
      MC = {{Cl|_MOUSEWHEEL}}
 +
      Clicks = Clicks + MC
 +
      LOCATE 10, 20: PRINT Clicks
 +
    LOOP
 +
LOOP UNTIL K$ = CHR$(13)
 +
{{CodeEnd}}
  
  

Revision as of 18:22, 18 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 values represent how many "clicks" the mouse wheel has been moved down.
  • Negative values represent how many "clicks" the mouse wheel has been moved up.
  • Return values are relative to the last time _MOUSEINPUT was used, so if no movement on the wheel has occurred since the last read, _MOUSEWHEEL returns 0.
  • You may want to use a cumulative mouse wheel click value.


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

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



See also



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