•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileMOUSEX
MOUSEY
MOUSEK
MOUSE mx,my,mk

mx, my, mk: avar

MOUSEX, MOUSEY, and MOUSEK return the X and Y coordinates of the mouse pointer,
and information on the state of the mouse buttons. MOUSE allows the gathering
of that information with one statement, giving the current mouse coordinates to
mx and my and the mouse button status to mk. MOUSEK (or mk) will return values
between 0 and 3, with the following meaning:

Note: These commands respect the current CLIP OFFSET.

    mk  Button(s) pressed
    0   None
    1   Left
    2   Right
    3   Both left and right

Example:

    REPEAT
      IF MOUSEK=1
        PLOT MOUSEX,MOUSEY
      ENDIF
    UNTIL MOUSEK=2
    '
    REPEAT
      MOUSE x%,y%,k%
      IF k%=2
        PLOT x%,y%
      ENDIF
    UNTIL k%=1

--> In the first REPEAT-UNTIL loop a point is plotted on the screen at the
    mouse pointer position if the left mouse button is pressed. When the right
    button is pressed the second REPEAT-UNTIL loop is entered. In the second
    loop, plotting takes place provided the right mouse button is held down.
    When the left button is pressed, the loop and the program both terminate.

Memo: These are actually Line-A variables.

      Command  Line-A Variables        Replacement Code
      MOUSE    GCURX, GCURY, MOUSE_BT
      MOUSEX   GCURX                   mx&=WORD{L~A-602}
      MOUSEY   GCURY                   my&=WORD{L~A-600}
      MOUSEK   MOUSE_BT                mk&=WORD{L~A-596}

      These commands internally shut the STICK() mode off. This can cause a
      problem if trying to use STICK(1) and MOUSEx at the same time. There's
      no easy workaround for this short of using a custom joystick handler
      written in assembler.

Line-A Variable Table+, graf_mkstate()+