# Java keyDown help

**URL:** <https://forum.kirupa.com/t/java-keydown-help/246515>\
**Category:** Uncategorized\
**Created:** [December 11, 2007, 9:16pm UTC](https://forum.kirupa.com/t/java-keydown-help/246515 "2007-12-11T21:16:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnboy0212](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@cnboy0212](https://forum.kirupa.com/u/cnboy0212)\
**Post date:** [December 11, 2007, 9:16pm UTC](https://forum.kirupa.com/t/java-keydown-help/246515/1 "2007-12-11T21:16:49Z")

</div>

i am currently making a 2 player applet pong game in java.I used the keyDown method.here is what the code look like

public boolean keyDown(Event e,int key)  
{  
if(key == Event.UP)  
//player1 move up  
if(key== Event.DOWN)  
//player1 move down  
if(key == 53)  
//player2 move up  
if(key == 50)  
//player2 move down  
}  
but the problem is that it only work with 1 key at a time.so if player 1 is moving,player 2 can not move,and while player 2 is moving,player 1 cannot move.is there a way to make 2 or more key pressing at the same time?
