Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pressing multiple buttons at the same time

843806Dec 7 2007 — edited Dec 8 2007
I've been using the "KeyListener" interface to detect key presses for my game. So far I've been able to make a character move around the screen with the arrow keys. But now I want the player to be able to press two arrow keys at once and go in a diagonal direction. This isn't possible with the "KeyListener" class though. I heard in the "New to Java" forum that I should use the a key binding class, but I looked into it and it said it was manipulated by a different class and only worked in the background. Now I'm stuck. What class does this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2008
Added on Dec 7 2007
11 comments
916 views