I need some info.

 BBS: Inland Empire Archive
Date: 11-21-92 (14:55)             Number: 376
From: RICHARD DALE                 Refer#: NONE
  To: DAVID KOUTS                   Recvd: NO  
Subj: I need some info.              Conf: (2) Quik_Bas
DK>        I'm kind of an amateur QBASIC programmer who likes to do a lot with
DK>graphics. I'm working on a (kind-of) drawing program, and was wondering if
DK>anyone could tell me how I could get input from a mouse?
DK>What commands would I


DEFINT A-Z
'$ INCLUDE QB.BI
DECLARE SUB hidemouse ()
DECLARE SUB showmouse ()
DECLARE SUB getmousecord (k%, k3%, m4%)
DECLARE SUB startmouse ()
DIM SHARED Inregs AS RegType, Outregs AS RegType

startmouse
showmouse

DO
    getmousecord k, x, y
    LOCATE 1, 1
    PRINT x, y, k
LOOP WHILE k = 0

hidemouse
END

SUB getmousecord (k%, m3%, m4%)
    Inregs.ax% = 3
    CALL interrupt(&H33, Inregs, Outregs)
    m3% = Outregs.cx% / 8 + 1
    m4% = Outregs.dx% / 8 + 1
    k% = Outregs.bx%
END SUB

SUB hidemouse
    Inregs.ax% = 2
    CALL interrupt(&H33, Inregs, Outregs)
END SUB

SUB showmouse
    Inregs.ax% = 1
    CALL interrupt(&H33, Inregs, Outregs)
END SUB

SUB startmouse
    Inregs.ax% = 0
    CALL interrupt(&H33, Inregs, Outregs)
    mouseinitialize% = Outregs.ax%
END SUB

 * 1st 1.01 #567 * Luxuriantly hand-crafted from only the finest ASCII.
--- FidoPCB v1.2 [ff013/c]
 * Origin: Sound Advice - 24 Nodes (816)436-4516 (1:280/333)
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