Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mouse pointer outside of application window issue  RSS feed

 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to get the coordinate of a mouse click outside of the java application window. I know how to get the mouse movement info outside the window, with the AWT class MouseInfo.

But MouseInfo doesn't support anything to capture mouse clicks (that I've seen). Can someone direct me to information on how to get this kind of mouse information?

I am mostly interested on how to do this on windows.

Thanks!

 
Suraj Chandran
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think with pure java it might not be possible.
You might need to fall down to JNI
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suraj Chandran wrote:I think with pure java it might not be possible.
You might need to fall down to JNI


Thanks. I am starting to think that you're right. I just think it's strange since it's easy to get the pointer location outside the window I thought it shouldn't be that hard to get mouse press information as well.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing strange about it. Everyone doesn't want to write spyware.
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:Nothing strange about it. Everyone doesn't want to write spyware.


For your info, I want to write a method that lets the user select an area of the screen to take a screen shot of, thus making use of mouse click coordinates. There are a million other non spyware applications that could make use of this mouse info, so please be a bit more creative and stop assuming the worst of people.
 
Bartek Myszkowski
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seb petterson wrote:...I want to write a method that lets the user select an area of the screen to take a screen shot of, thus making use of mouse click coordinates

You can always get screenshot of whole screen and show it to user in full screen mode to let him select the area he wants.
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bartek Myszkowski wrote:
seb petterson wrote:...I want to write a method that lets the user select an area of the screen to take a screen shot of, thus making use of mouse click coordinates

You can always get screenshot of whole screen and show it to user in full screen mode to let him select the area he wants.


Yes, something like that could work as a next best thing I guess. Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!