Computer Science Canada [Tutorial] How to use a mouse in your Turing programs |
Author: | Dan [ Tue Aug 20, 2002 9:14 pm ] | ||
Post subject: | [Tutorial] How to use a mouse in your Turing programs | ||
How to use a mouse in Turing This is a simple code but it can be hard to keep on finding out where the mouse is at all times. The mouse code: Mouse.Where (X, Y, Button) %all values are int's X is the x quadrant of the mouse Y is the y quadrant of the mouse Button is 0 if the button on the mouse is not down and is 1 if the button is down on the mouse. Note: this is only true if the mouse is set to single-button mode; it should be by default. How to use this code:
Note if you want to make a game or program that uses a mouse you should have the mouse where command in some kind of loop to keep on getting the quadrants of the mouse. This was my 2nd Tutorial for this borad, plz re and tell me what you think about it. |
Author: | KeN [ Tue Sep 24, 2002 6:02 am ] |
Post subject: | |
Great tutorial. Perhaps you know the code for when you click and object for it to perform something with the mouse. |
Author: | Tony [ Tue Sep 24, 2002 2:03 pm ] | ||
Post subject: | |||
VB would be great for that since its object oreanted. (Winoot doesn't mean shit, it's still text based) Otherwise, in turing you can run a check to see if sertain object is clicked on or not, such as in
don't forget to put all that in a loop, otherwise it will check for mouse status only once |
Author: | Stuperman [ Fri Nov 29, 2002 4:41 am ] |
Post subject: | |
sweet |
Author: | cutecotton [ Mon Dec 23, 2002 1:08 am ] |
Post subject: | |
very nice, and really helpful..i just got a litte question related to mouse-use in turing. I know there's a way to do this. So let's say you ahve a box at the bottom, and everytime the user rolls thier mouse of it, the box will turn blue. How can you do that? but the user wont' have to click in order for the box to turn blue, just rolling thier mouse over it does that. |
Author: | Tony [ Mon Dec 23, 2002 2:11 am ] | ||
Post subject: | |||
well then you just check for the mouse location... such as
|
Author: | cutecotton [ Mon Dec 23, 2002 2:35 am ] |
Post subject: | |
tks tha'ts just waht i needed...^^ |
Author: | JSBN [ Thu Jan 30, 2003 5:21 pm ] | ||||
Post subject: | Mouse | ||||
here's my little tutorial for using the mouse it explains everything Basically i have cut and pasted from games i got from this site & put it into a nice little, well documeted program. F.Y.I - there is an alternative method to figure out when the mouse button is clicked(which i prefere because this one can cause problems). I put it at the bottom after this main code.
here's that extra code:
|
Author: | Vicous [ Mon Mar 03, 2003 6:28 am ] |
Post subject: | advanced mouse work |
I was reading the help section, and I get the idea that gui has more advanced mouse functions, how about a more advanced mouse titorial (I know that's not spelled right, I just can't think of the correct spelling right now) like with buttons and such |
Author: | TheFreshPrince [ Tue May 04, 2004 7:48 pm ] |
Post subject: | |
thnx for the help |
Author: | Flashkicks [ Fri May 07, 2004 7:41 am ] |
Post subject: | |
I think if you are going to post a tutorial- you should add as MUCH of information regarding the command/predefined command as it is possible for that command to use. Baically, a tutorial that for one answers all the questions you have seen been asked thus far; and two- explaining the other functions the mouse can do as well. Such as right clicking and so on. That is just my thoughts though.. Nothing too important really. Good job man!!! |
Author: | Dan [ Fri May 07, 2004 11:59 am ] |
Post subject: | |
well if u checked the date on the tutorial u whould know that i made it b4 turing 4.x was out yet. So i belive all the Mouse.somting comands did not yet existed. |
Author: | The_Triangle [ Thu Nov 24, 2005 5:39 am ] |
Post subject: | |
anyone know how to make the mouse scroll over a button in a game, and for instance like in a game, the mouse turns into the hand bar while it is scrolled over a button? im tryin to make that work in my game, no such luck. I tried finding that hand picture of the mouse but no luck finding it either, i also tried snapshotting the screen and the mouse hand didnt show up. Any one know how to do this ? |
Author: | Tony [ Thu Nov 24, 2005 9:17 am ] |
Post subject: | |
The mouse is controlled by OS, therefor you'd require system API.. something outside of Turing's scope. |
Author: | The_Triangle [ Thu Nov 24, 2005 4:19 pm ] |
Post subject: | |
Tony wrote: The mouse is controlled by OS, therefor you'd require system API.. something outside of Turing's scope.
nooo like i mean how people do the mousehand thing in flash games, and msn has it to ... if that helps ya |
Author: | Tony [ Thu Nov 24, 2005 4:32 pm ] |
Post subject: | |
Flash and MSN weren't made with Turing |
Author: | MysticVegeta [ Thu Nov 24, 2005 6:26 pm ] |
Post subject: | |
This can be done in VB right? |
Author: | Tony [ Thu Nov 24, 2005 7:14 pm ] |
Post subject: | |
anything with Windows API access. VB is pretty simple, there are code sniplets available all over the place (MSDN?). |
Author: | The_Triangle [ Thu Nov 24, 2005 8:24 pm ] |
Post subject: | |
what does Windows API access stand for? And why doesnt turing have access to it ? Wouldnt it be so much easier... damn.. lol |
Author: | Tony [ Thu Nov 24, 2005 8:36 pm ] |
Post subject: | |
no, it would make things unneccessary complicated - that's why. you'd need to hook Turing into the OS, and perform all those low level operations. Not something you teach highschool students.. or want them to be able to use for that matter. Just imagine - program calls a command to make mouse cursor invisible, then quits. Oh damn it, you've just lost your mouse until you reboot or write another program to fix things. |
Author: | [Gandalf] [ Fri Nov 25, 2005 3:33 pm ] |
Post subject: | |
API stands for Application Program Inferface. |
Author: | Dan [ Sun Nov 27, 2005 7:57 pm ] |
Post subject: | |
Tony wrote: Just imagine - program calls a command to make mouse cursor invisible, then quits. Oh damn it, you've just lost your mouse until you reboot or write another program to fix things. And thats why VB is a script kiddys dream. |
Author: | [Gandalf] [ Mon Nov 28, 2005 1:04 am ] |
Post subject: | |
Maybe if you edited the executable, and changed the cursor there? Just an idea... |
Author: | Tony [ Mon Nov 28, 2005 9:23 am ] |
Post subject: | |
you could Sys.Exec() VB programs that change cursors for you. |
Author: | progammin_nub [ Thu May 11, 2006 10:16 pm ] |
Post subject: | Some part of my coding. |
%The status of my mouse buttonwait ("down", mx, my, buttonnumber, buttondown) Hello, I am just wondering for the mouse status for my program. When I specify "down", will Turing automatically tells itself to wait for the button to be pressed? |
Author: | Anonymous [ Sat Jun 17, 2006 10:36 pm ] | ||||||
Post subject: | Multi-Button | ||||||
You forgot to mention Multi-Button, since it wasn't out when you posted this I guess. As you would assume, Multi-Button allows left click, right click, and middle click on Windows (possibly Mac I don't know). At the top of your program, declare:
Now you should set your mouse variables, here's my example:
Next you must locate your mouse and status, usually in a loop. Here I will display current mouse information:
Put those three pieces of code together to have a fully functional multi-button mouse! |
Author: | gohabsgo007 [ Mon Dec 08, 2014 5:11 pm ] |
Post subject: | Re: [Tutorial] How to use a mouse in your Turing programs |
I want to know how to make a picture, uploaded from my computer, to move when the user clicks on it. |
Author: | Insectoid [ Mon Dec 08, 2014 7:43 pm ] |
Post subject: | RE:[Tutorial] How to use a mouse in your Turing programs |
Easy. Upload a picture from the computer, check if the user clicks on it, then move it. |
Author: | gohabsgo007 [ Tue Dec 09, 2014 4:54 pm ] |
Post subject: | Re: [Tutorial] How to use a mouse in your Turing programs |