Page 1 of 1

one more question

Posted: Thu May 25, 2006 8:11 pm
by jr1212
What kind of statement would I use to have my mouse click on something???

Posted: Thu May 25, 2006 8:24 pm
by DaveUnit
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.

Posted: Fri May 26, 2006 2:59 am
by Theophage
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...

Posted: Fri May 26, 2006 9:26 am
by jr1212
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...

Posted: Fri May 26, 2006 9:29 am
by jr1212
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...

Posted: Fri May 26, 2006 1:03 pm
by Theophage
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...

Posted: Fri May 26, 2006 1:29 pm
by DaveUnit
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.