BBS: Inland Empire Archive Date: 03-15-92 (00:40) Number: 186 From: MICHAEL ZIELENSKI Refer#: NONE To: JASON HATCH Recvd: NO Subj: mouse in qb Conf: (2) Quik_Bas
JH> THANKS FOR WRITING. I AM NOT NEW TO BASIC, JUST QUICK BASIC. I HAVE
JH> WRITTEN PROGRAMS WHICH USE HOMEMADE DEVICES TO CONTROL EXTERNAL DEVICES
JH> THROUGH A PARALELL PORT. WHAT WOULD THE POSSIBILITY OF USING THE INP
JH> FUNCTION OR POSSIBLY OPENING COM1(MOUSE) FOR INPUT?
JH> JASON HATCH
Please do not write your messages in CAPS only (it hurts the eyes).
Here is a sample listing of a mouse routine that shows the
mouse pointer on your screen, and then hides it when a
button is pressed (load QB with
the /L switch):
---
'$INCLUDE: 'QB.BI'
DIM SHARED InRegs as RegType, OutRegs as RegType
CLS
PRINT "Press a mouse button to quit..."
InRegs.AX = &H1
CALL INTERRUPT(&H33, InRegs, OutRegs) 'Show pointer
DO
InRegs.AX = &H3 'LOOP UNTIL a button
CALL INTERRUPT(&H33, InRegs, OutRegs) ' is pressed
Button%=OutRegs.BX
LOOP UNTIL Button% <> 0
InRegs.AX = &H2 'Hide pointer
CALL INTERRUPT(&H33, InRegs, OutRegs)
---
I would suggest you play around with this routine, and ask more
questions if you encounter problems. One more thing: the values of
Button% can be 1 (left button pressed), 2 (right button pressed), 3
(both buttons pressed simultaneously), and ofcourse 0 (no button[s]
pressed).
Regards,
Mike
--- Maximus/2 2.01wb
* Origin: iKon Window Too * Toronto, Canada * USR DS (1:250/818)

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