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

    Default A KeyListener that doesn't require focus

    Is there a way to make a KeyListener that, for example, doesn't require the frame to be in focus to be actively listening?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,879
    Rep Power
    8

    Default Re: A KeyListener that doesn't require focus

    Why do you think you want to do this? This goes against a bunch of Java design decisions.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    vaano is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Re: A KeyListener that doesn't require focus

    I want to make a program that runs on my second monitor while I'm playing League of Legends, I would press a certain number on the keyboard and it would activate a timer in the program. The current programs out aren't very efficient for me so I would like to make it by hand.

  4. #4
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,234
    Rep Power
    7

    Default Re: A KeyListener that doesn't require focus

    You can't do that in Java.

    But if the frame does have focus then you should read up on: How to Use Key Bindings (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)

Similar Threads

  1. Replies: 4
    Last Post: 10-30-2011, 06:52 AM
  2. Require help with ArrayList
    By Mario_1990 in forum New To Java
    Replies: 20
    Last Post: 08-19-2011, 05:24 PM
  3. Require HELP, Please
    By nura23 in forum New To Java
    Replies: 5
    Last Post: 01-10-2010, 02:41 AM
  4. Require some insight!
    By Shaolin in forum JavaServer Pages (JSP) and JSTL
    Replies: 13
    Last Post: 07-15-2008, 11:36 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
  •