Jump to content
  • Advertisement
Sign in to follow this  
NotTheCommonDose

[RESOLVED] Java KeyListener problem

This topic is 3852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For some weird reason I run this code and it doesn't work. It does not even print out the test line I put in there. I'm running ubuntu (Linux) I do not know if that is related. It's very strange that it does not work.
        addKeyListener( new KeyAdapter() {
        public void keyPressed(KeyEvent e)
       {System.out.println("test");
            processKey(e);
       }});


[Edited by - NotTheCommonDose on April 3, 2008 10:47:42 PM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by NotTheCommonDose

addKeyListener(
        new KeyAdapter()
        {
            public void keyPressed(KeyEvent e)
            {
                System.out.println("test");
                processKey(e);
            }
        }
    );





. . .

How is that remotely legal?


Did you try looking up the documentation?

Also, it seems that this guy is having the same problem as you are having.

Share this post


Link to post
Share on other sites
Issue resolved, the problem was not my code but rather for some reason the window was either not requesting focus or it lost focus somewhere along the line (Which is wierd cause I can not see where)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!