public static boolean KEY_F1;
private static KeyMapper keyMapper = new KeyMapper();
public static void handleKeys(){
KeyState state = null;
while((state = keyMapper.poll()) != KeyState.NONE){
int code = state.getKeyCode();
if(code == KeyEvent.VK_1){
KEY_1 = state.getState();
}
else if(code == KeyEvent.VK_2){
KEY_2 = state.getState();
}
else if(code == KeyEvent.VK_3){
KEY_3 = state.getState();
}
else if(code == KeyEvent.VK_4){
KEY_4 = state.getState();
}
else if(code == KeyEvent.VK_5){
KEY_5 = state.getState();
}
else if(code == KeyEvent.VK_6){
KEY_6 = state.getState();
}
else if(code == KeyEvent.VK_7){
KEY_7 = state.getState();
}
else if(code == KeyEvent.VK_8){
KEY_8 = state.getState();
}
else if(code == KeyEvent.VK_9){
KEY_9 = state.getState();
}
else if(code == KeyEvent.VK_0){
KEY_0 = state.getState();
}
else if(code == KeyEvent.VK_DOWN){
DOWN_PRESSED = state.getState();
}
else if(code == KeyEvent.VK_UP){
UP_PRESSED = state.getState();
}
else if(code == KeyEvent.VK_LEFT){
LEFT_PRESSED = state.getState();
}
else if(code == KeyEvent.VK_RIGHT){
RIGHT_PRESSED = state.getState();
}
else if(code == KeyEvent.VK_PAGE_DOWN){
PAGE_DOWN_PRESSED = state.getState();
}
else if(code == KeyEvent.VK_PAGE_UP){
PAGE_UP_PRESSED = state.getState();
}
else if(code == KeyEvent.VK_F1){
KEY_F1 = state.getState();
}
else if(code == KeyEvent.VK_P){
KEY_P = state.getState();
}
else if(code == KeyEvent.VK_ESCAPE){
KEY_ESC = state.getState();
}
}
}