Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 1677
Number of posts: 4766

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Qbasic mouse help Posted by mstechca on 28 Apr 2001 at 9:44 AM
Everywhere I look, I see a mouse program that is created using
Call Absolute and Call Interrupt function. Where can I get
a Qbasic program that requires a serial mouse and accesses
the mouse port directly without requiring any other file?

I want something like...
INP(&H3F8)

I DO NOT WANT....
Call Absolute (ax%,bx%,cx%,dx%)
Call Interrupt(&H33,in%,out%)

Those two could screw up a computer. One of them requires
Qb.lib. It is preferred to e-mail the answer directly to
info@mstca.com

Report
Re: Qbasic mouse help Posted by billywm664 on 29 Apr 2001 at 7:51 AM
They will not screw up the computer. I don't know where to even begin imagining where you got that idea.
And it's not likely you'll ever find this program you're looking for. A program written that actually interfaces with the mouse, like i imagine the program you want would have to, would be insanely complicated to program. That's why, the mouse drivers written in ASM and called with Call Absolute, don't really do a whole lot. They just use the DOS Mouse Driver, which does all the work.

: Everywhere I look, I see a mouse program that is created using
: Call Absolute and Call Interrupt function. Where can I get
: a Qbasic program that requires a serial mouse and accesses
: the mouse port directly without requiring any other file?
:
: I want something like...
: INP(&H3F8)
:
: I DO NOT WANT....
: Call Absolute (ax%,bx%,cx%,dx%)
: Call Interrupt(&H33,in%,out%)
:
: Those two could screw up a computer. One of them requires
: Qb.lib. It is preferred to e-mail the answer directly to
: info@mstca.com
:


Report
Re: Qbasic mouse help Posted by retrogeek on 1 May 2001 at 6:02 AM
: Everywhere I look, I see a mouse program that is created using
: Call Absolute and Call Interrupt function. Where can I get
: a Qbasic program that requires a serial mouse and accesses
: the mouse port directly without requiring any other file?
:
: I want something like...
: INP(&H3F8)
:
: I DO NOT WANT....
: Call Absolute (ax%,bx%,cx%,dx%)
: Call Interrupt(&H33,in%,out%)
:
: Those two could screw up a computer. One of them requires
: Qb.lib. It is preferred to e-mail the answer directly to
: info@mstca.com
:
Hi mstechca!

An interesting project! But I fear, "insanely complicated" as billywm664 puts it! You are right to be concerned about QBASIC programs that call DOS services or drivers. They can be written to do damage. But you are probably ok with programs that call int33h as this IS where the mouse driver lives.

Mouse drivers are rather complicated and use interrupt routines that cannot be done directly in QBASIC. The mouse itself simply puts out ascii serial characters so if you want to experiment, simply OPEN a channel to the com port (1200 baud) and read in characters as you move the mouse or push buttons. Hmmmmm. Having said that, I am beginning to think that it might not be so complicated after all! Anyway, there is a place to start

good luck!

rg

Report
Re: Oops...I should mention... Posted by retrogeek on 1 May 2001 at 6:07 AM
that using the com port method only applies to serial port mice. Won't work with ps2/USB mice.

rg

Report
Re: Qbasic mouse help Posted by tburcham on 10 Feb 2002 at 1:11 PM
: Everywhere I look, I see a mouse program that is created using
: Call Absolute and Call Interrupt function. Where can I get
: a Qbasic program that requires a serial mouse and accesses
: the mouse port directly without requiring any other file?

Hi,
I have two PBDOS3.5 serial mouse driver demos.
They use an inline asm port polling routine to
get the "mouse packets". One demo is for 2-button
and the other for 3-button mice. These don't
require any BIOS/DOS or other interrupt calls,
nor external drivers or other files. The asm
portions should be easy to translate to basic.
Let me know if you have any questions.

http://www.gvii.net/tburcham/PBMOUSE.zip
http://www.gvii.net/tburcham/3BMOUSE.zip
(the odd choice of file names is because the
3-button demo was an after-thought)







 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.