Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 The right and left click buttons
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chalcids




PostPosted: Wed May 30, 2012 7:10 pm   Post subject: Re: The right and left click buttons

if i knew how to do that i wouldn't be asking how to do it because there was nothing on what i asked that i learned from that book
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: Wed May 30, 2012 8:10 pm   Post subject: RE:The right and left click buttons

Lets go through it then.

You have a procedure:
Turing:

Mouse.Where (x, y, b)

This procedure will take in three variables that already exist. Lets do that then.
Turing:

var x, y, b : int

loop
     Mouse.Where (x, y, b)
end loop


So now we have a short program where we have a loop that returns the x position, y position and the button state of the mouse.

I've already given you plenty of information, if you dont know where to go from this, I don't really know why you're trying to do something this advanced.
chalcids




PostPosted: Wed May 30, 2012 8:15 pm   Post subject: Re: The right and left click buttons

you said this tells me where the mouse is. I am don't care where the cursor is i want to click randomly and a . will appear when i left click and when i right click a - appears and doesn't need that advanced stuff would it?
Tony




PostPosted: Wed May 30, 2012 8:48 pm   Post subject: RE:The right and left click buttons

right, but you still need to know if that click has occurred or not. That's what "b" in x,y,b is for.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Luffy123




PostPosted: Wed May 30, 2012 9:11 pm   Post subject: Re: The right and left click buttons

chalcids @ Wed May 30, 2012 8:15 pm wrote:
you said this tells me where the mouse is. I am don't care where the cursor is i want to click randomly and a . will appear when i left click and when i right click a - appears and doesn't need that advanced stuff would it?


You don't have to worry about the variables x, y.

Mouse.Where(x,y,b)

The b is the above method is the button number as in. Right Click, Left Click, Scroll Wheel but the b returns an int value which represents these clicks. So first you have to get the value of b by using this method.

Then check if it's a right click or a left click, and you know how to do this because someone posted in this thread what each click's value is. I don't know the values but you just have to check if b = the click you want's value.

Really I don't think it can get easier then this...
chalcids




PostPosted: Thu May 31, 2012 7:30 am   Post subject: Re: The right and left click buttons

okay thanks luffy now i actually understand and thanks to everyone else
chalcids




PostPosted: Thu May 31, 2012 7:39 am   Post subject: Re: The right and left click buttons

wait one more issue when i run that code and test the keys the values for my right and left click are both 1 what do i then
jr5000pwp




PostPosted: Thu May 31, 2012 7:46 am   Post subject: Re: The right and left click buttons

Somewhere near the top of your code include the line:
code:
Mouse.ButtonChoose ("multibutton")


This allows turing to distinguish between the 3 mouse clicks.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 23 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: