•  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-FileEVNT_MOUSE(flag,mx,my,mw,mh[,mcur_x,mcur_y,button,k_state])

flag, mx, my, mw ,mh: iexp
mcur_x, mcur_y, button, k_state: ivar

Waits for the mouse pointer to be located inside (or, optionally, outside) a
specified rectangular area of the screen.

The returned value is always 1.

    flag    - Presence inside (0) or outside (1) of the area is detected.
    mx      - x-coordinate of top left corner of rectangle.
    my      - y-coordinate of top left corner of rectangle.
    mw      - Width of rectangle.
    mh      - Height of rectangle.
    mcur_x  - Returns x-coordinate of mouse pointer when event occurs.
    mcur_y  - Returns y-coordinate of mouse poniter when event occurs.
    button  - Returns mouse button status when event occurs.
              Bit 0: Right button
              Bit 1: Left button
    k_state - Returns state of the keyboard 'shift' keys when event occurs.
              Bit 0: Right shift key
              Bit 1: Left shift key
              Bit 2: Control key
              Bit 3: Alternate key
              Bit 7: AltGr (Milan)

The parameters mcur_x, mcur_y, button, and k_state are optional, these values
can also be found by querying GINTOUT(1) to GINTOUT(4).

Example:

    DO
      ~EVNT_MOUSE(0,100,100,200,90,mx%,my%,bu%,kb%)
      IF bu%
        PBOX mx%-10,my%-10,mx%+10,my%+10
      ELSE
        PLOT mx%,my%
      ENDIF
    LOOP UNTIL BTST(kb%,2)

--> The program waits until the mouse pointer is located inside the rectangle.
    Then a point is plotted at the mouse position, or a small square is drawn
    if the left mouse button is pressed. The program is ended if the Control
    key is held down while the pointer is within the rectangle. Compare the
    effect produced by making the first parameter 1 instead of 0.

Note: While a GEM routine is being executed, the 'break' keys
      (Control-Shift-Alternate) can be pressed, but will not take effect until
      execution has returned to the BASIC part of the program. In general
      though, it is best to exit from programs in the manner provided by the
      program, otherwise memory restoration, etc, may not take place.

evnt_mouse()+