?
Solved

track mouse click event outside frame

Posted on 2005-04-09
10
Medium Priority
?
575 Views
Last Modified: 2011-10-03
Hi

Just might appear silly. Normally awe add a mouselistener to a frame and then track the keypressed event blah blah.

Is there a way to track a mouse event after the mouse had exited from the frame??

I am trying to run a java program that constantly keeps tracking the mouse event that occur.
Anyone has any idea how to do this??

I tot of creating an invisible frame with a mouselistener that tracks events outside this frame.
0
Comment
Question by:linchong
  • 4
  • 4
  • 2
10 Comments
 
LVL 14

Expert Comment

by:StillUnAware
ID: 13742935
This is only possible since java 1.5 in awt package, there are two classes MouseInfo and PointerInfo for thing like that.
0
 
LVL 14

Expert Comment

by:StillUnAware
ID: 13743021
On the other hand You won't be able to register mouse events outside the visible frame, You can only get the pointer position on the screen. What You need can be accomplished only by using some native code with JNI.
0
 

Author Comment

by:linchong
ID: 13744227
which mean something in c or c++.

so might as well write all in c???
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:Mayank S
ID: 13746523
Try adding a WindowFocusListener to your Frame and handle the windowLostFocus () event. See if it works.
0
 

Author Comment

by:linchong
ID: 13749717
Failed

Actually to elaborate further, I am trying to have a overriding mouse listener that tracks all mouse event in all appications including windows apps.

What I am doing is to get the data from the clipboard using TextTransfer method. I wonder if it is possible to detect state change in the clipborad and then copy to a log file.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 13750473
>> Failed

Can you tell what exactly happened?
0
 

Author Comment

by:linchong
ID: 13753400
cannot trigger mouse event after lostfocus
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 13753460
What did you write in the event-handler?
0
 

Author Comment

by:linchong
ID: 13778169
how do i call mouse event after lostfocus??  afraid i m wrong.
any example to show?
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 200 total points
ID: 13778742
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question