Results 1 to 7 of 7
  1. #1
    bayan is offline Member
    Join Date
    Apr 2010
    Posts
    55
    Rep Power
    0

    Default 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-

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,581
    Rep Power
    25

    Default

    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.

  3. #3
    bayan is offline Member
    Join Date
    Apr 2010
    Posts
    55
    Rep Power
    0

    Default

    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.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,581
    Rep Power
    25

    Default

    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.

  5. #5
    bayan is offline Member
    Join Date
    Apr 2010
    Posts
    55
    Rep Power
    0

    Default

    Thanks norm ill try it and see if it works, ill post what happens here.

    Thanks for the help :)

    -Bayan-

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,581
    Rep Power
    25

    Default

    Yes, I'd be interested in what you find.
    Good luck.

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,581
    Rep Power
    25

    Default

    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.html
    Last edited by Norm; 06-14-2010 at 04:54 PM.

Similar Threads

  1. Focus traversal keys not responding
    By javaexplorer in forum AWT / Swing
    Replies: 1
    Last Post: 02-16-2010, 08:52 AM
  2. The trouble with handling the button clicks
    By Borneq in forum New To Java
    Replies: 3
    Last Post: 01-10-2010, 02:57 PM
  3. How to swap to images on clicks
    By ntagrafix in forum AWT / Swing
    Replies: 2
    Last Post: 12-03-2009, 08:13 PM
  4. Responding to button presses
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 07:38 PM
  5. Replies: 0
    Last Post: 06-03-2008, 11:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •