one more question

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
jr1212
Newbie
Posts: 5
Joined: Tue May 23, 2006 10:01 pm

one more question

Post by jr1212 » Thu May 25, 2006 8:11 pm

What kind of statement would I use to have my mouse click on something???

DaveUnit
Veteran
Posts: 72
Joined: Sat Oct 29, 2005 10:07 am
Contact:

Post by DaveUnit » Thu May 25, 2006 8:24 pm

What you need to do is identify where on the screen is clickable
let's say (0,0)-(10,10) is clickable
then, you check to see if the left mouse button is clicked and if so where is it clicked and if it is in that clickable area...
it goes to a sub or something to do whatever you want it to.

User avatar
Theophage
Coder
Posts: 44
Joined: Sun May 07, 2006 7:32 pm
Location: Tucson, AZ
Contact:

Post by Theophage » Fri May 26, 2006 2:59 am

mouse input is not easily done in QBASIC without an included library. Are you going to use one of those? You know, FreeBasic has mouse commands already there...
Daniel "Theophage" Clark
theophage (at) geocities (dot) com

"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."

jr1212
Newbie
Posts: 5
Joined: Tue May 23, 2006 10:01 pm

Post by jr1212 » Fri May 26, 2006 9:26 am

Yes, I have the mouse driver and all of that I just need to know what statement to use when I need to input where to click.
By the way when I start the program it says mouse found and initialized, however on full screen I don't see the mouse...

jr1212
Newbie
Posts: 5
Joined: Tue May 23, 2006 10:01 pm

Post by jr1212 » Fri May 26, 2006 9:29 am

Yes, I have the mouse driver and all of that I just need to know what statement to use when I need to input where to click.
By the way when I start the program it says mouse found and initialized, however on full screen I don't see the mouse...

User avatar
Theophage
Coder
Posts: 44
Joined: Sun May 07, 2006 7:32 pm
Location: Tucson, AZ
Contact:

Post by Theophage » Fri May 26, 2006 1:03 pm

I'm afraid either you or I still are unclear. A mouse driver[/] is a program that Windows uses to control the mouse. Such a program does nothing for QBASIC.

QBASIC has no commands for using the mouse, and using the mouse requires using Assembler language routines written especially to read and write to the I/O memory registers that the mouse uses. Is this what you meant by a "driver"?

Then there are pre-written libraries you can use with QBASIC, which when included with the #INCLUDE statment (I think that's right) give commands to use the mouse. If you were using one of these, you would already know what commands to use, since it would be in the documentation of the library.

So really, I have no idea what you are using to control your mouse in QBASIC, so I have no idea what programming commands you need to use it.

More info please...
Daniel "Theophage" Clark
theophage (at) geocities (dot) com

"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."

DaveUnit
Veteran
Posts: 72
Joined: Sat Oct 29, 2005 10:07 am
Contact:

Post by DaveUnit » Fri May 26, 2006 1:29 pm

If you don't have something already to use the mouse in qb, and you don't wanna use a library, I suggest grabbing some code from one of Vic's game tutorials for the mouse. That's what I used when I was still using QB.
Or you can try freebasic with built in mouse support as was already mentioned.

Post Reply