Results 1 to 4 of 4
  1. #1
    rolfrolf is offline Member
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Default Unfocused keylistener

    Hello

    I'm working on a project for school where I need to listen for a buttonpress on an unfocused application and I have no idea how to do this or if Java even can do this.

    The application I'm doing is a screenshot grabber that listens to the PrntScrn key.

    Any help is appreciated, thanks in advance.

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

    Default

    Not sure that a Java program can listen for events if it doesn't have the focus.

  3. #3
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    7

    Default

    maybe write an application that has the keypressed listener in it but make the shell size 0X0 and have no views or anything in it and then somehow find a way to maintain that, that application always stays on top? Sorta like you have a ghost program running ontop of everything else.

  4. #4
    rolfrolf is offline Member
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Default

    Wouldn't that cause problems with the other program that you work with? let's say if you play a game or something.

Similar Threads

  1. keyListener isn't working for me
    By lost_in_java in forum AWT / Swing
    Replies: 7
    Last Post: 12-05-2008, 05:24 AM
  2. KeyListener Example
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:46 PM
  3. How to use KeyListener and ActionListener
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 04-23-2008, 09:19 PM
  4. how to add a KeyListener
    By leonard in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 05:44 PM
  5. Help with KeyListener in applet
    By mathias in forum Java Applets
    Replies: 1
    Last Post: 08-06-2007, 03:22 AM

Posting Permissions

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