ICONS... ICO'S

 BBS: Inland Empire Archive
Date: 10-29-92 (17:42)             Number: 324
From: FRED DISANO                  Refer#: NONE
  To: JERRY HUNTER                  Recvd: NO  
Subj: ICONS... ICO'S                 Conf: (2) Quik_Bas
  I was reading this message and I noticed you wanted some
mouse support in QB 4.5 right, okay here is some.  Load Qb
with the /L QB option and use interrupts, here's an example
for initializing the mouse and displaying the cursors.

' Mouse routines
REM $INCLUDE: 'QB.BI'
DEFINT A-Z

DIM IREGS AS REGTYPEX,OREGS AS REGTYPEX

CLS:SCREEN 12

'INIT MOUSE

IREGS.AX=&H0
INTERRUPTX &H33,IREGS,OREGS
STAT=OREGS.AX 'RETURNS A -1 IF THERE'S A MOUSE OR A 0 IF THERES NO MOUSE
BUTTONS=OREGS.BX 'RETURNS: -1 2 BUTTONS, 0 OTHER THAN 2, 3 MOUSE SYSTEM MOUSE.

? STAT,BUTTONS

' SHOW MOUSE CURSOR
IREGS.AX=&H1
INTERRUPTX &H33,IREGS,OREGS

' HIDE MOUSE CURSOR
'IREGS.AX=&H2
'INTERUPTX &H33,IREGS,OREGS

' AND HERE'S A SUB TO RETURN THE CORDINATES AND BUTTONS BEING PRESSED
DO
 IREGS.AX=&H3
INTERRUPTX &H33,IREGS,OREGS
BUTT=OREGS.BX
COL=OREGS.CX
ROW=OREGS.DX
LOCATE 1,1:?"ROW";ROW;"COL";COL;"BUTTON:";BUTT
LOOP UNTIL INKEY$=CHR$(32)

END

--- GEcho 1.00/beta
 * Origin: Digitized Reality (1:163/516)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET