Results 1 to 7 of 7
- 06-14-2010, 02:17 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 55
- Rep Power
- 0
Responding to clicks outside a window
Note that I do not intend to write or distribute any form of malware.
How would you make a java program respond to a click outside the window the program is running in. Im trying to write a program that keeps a tally of the number of actions I do in a game I play, mouseClicked and mousePressed dont work so how would you do it?
-Bayan-
- 06-14-2010, 02:43 PM #2
Is the game program written in java? If so, you could "host" it in your java program and maybe then add some listeners to trap actions.
- 06-14-2010, 03:13 PM #3
Member
- Join Date
- Apr 2010
- Posts
- 55
- Rep Power
- 0
Yes the game is a browser based java game.
-Bayan-
EDIT: If browser based does not work there is an open source java based client I could use.Last edited by bayan; 06-14-2010 at 03:18 PM.
- 06-14-2010, 03:30 PM #4
I have no idea if this will work as you want, but here is how you could "host" the game.
If the game is a application with a main(String[] args) method,
Write a program that calls that method:
Game.main(new String[] {});
Now what??? You don't have access to the games components to set listeners. But you do have the code running in your JVM.
- 06-14-2010, 03:34 PM #5
Member
- Join Date
- Apr 2010
- Posts
- 55
- Rep Power
- 0
Thanks norm ill try it and see if it works, ill post what happens here.
Thanks for the help :)
-Bayan-
- 06-14-2010, 03:35 PM #6
Yes, I'd be interested in what you find.
Good luck.
- 06-14-2010, 04:51 PM #7
More ideas. Copy the source for the classes most likely used by the Game and add your debugging/trapping code to it. Then put you version of the class in a library and prefix that library to the classpath.
I did something like that years ago when I was having trouble debugging some problem. I think I posted a description on this forum on what I did. I'll check.
http://www.java-forums.org/java-tips...-problems.htmlLast edited by Norm; 06-14-2010 at 04:54 PM.
Similar Threads
-
Focus traversal keys not responding
By javaexplorer in forum AWT / SwingReplies: 1Last Post: 02-16-2010, 08:52 AM -
The trouble with handling the button clicks
By Borneq in forum New To JavaReplies: 3Last Post: 01-10-2010, 02:57 PM -
How to swap to images on clicks
By ntagrafix in forum AWT / SwingReplies: 2Last Post: 12-03-2009, 08:13 PM -
Responding to button presses
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:38 PM -
JAXB unmarshall not responding (help needed)
By Buglish in forum XMLReplies: 0Last Post: 06-03-2008, 11:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks