Reporting X Y coordinates of mouse pointer

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2007
Posts: 77
Reputation: aot is an unknown quantity at this point 
Solved Threads: 1
aot's Avatar
aot aot is offline Offline
Junior Poster in Training

Reporting X Y coordinates of mouse pointer

 
0
  #1
Oct 23rd, 2008
I'd really like to be able to ask my program "where is the mouse pointer?" at any given time.

Ideally I'll want people to click and hold a button, which will cause a stream of events to occur, and then (at varying points) the program should find out where their mouse pointer is (while they are still holding down the button).

Is this possible? I've looked into the Canvas widget and feel that the answer must be there, but haven't been able to find it.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,049
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 264
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is

Re: Reporting X Y coordinates of mouse pointer

 
1
  #2
Oct 23rd, 2008
Refer to this post
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 77
Reputation: aot is an unknown quantity at this point 
Solved Threads: 1
aot's Avatar
aot aot is offline Offline
Junior Poster in Training

Re: Reporting X Y coordinates of mouse pointer

 
0
  #3
Oct 23rd, 2008
Ahh, thanks!

I was hoping to incorporate this functionality into Tkinter though. Is this possible too?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,049
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 264
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is

Re: Reporting X Y coordinates of mouse pointer

 
0
  #4
Oct 23rd, 2008
Looks like you can do that according to this post
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 77
Reputation: aot is an unknown quantity at this point 
Solved Threads: 1
aot's Avatar
aot aot is offline Offline
Junior Poster in Training

Re: Reporting X Y coordinates of mouse pointer

 
0
  #5
Oct 23rd, 2008
Ahh, also, his code only collects the mouse coordinates on a button click. I need to be able to query for them WHILE the person is holding down a button -- so the program has to be able to do it on its own.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC