@Override
        public void keyPressed(KeyEvent e) {
            switch (e.getKeyCode()) {
                case KeyEvent.VK_UP:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_UP] = true;
                    break;
                case KeyEvent.VK_DOWN:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_DOWN] = true;
                    break;
                case KeyEvent.VK_LEFT:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_LEFT] = true;
                    break;
                case KeyEvent.VK_RIGHT:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_RIGHT] = true;
                    break;
                case KeyEvent.VK_A:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_A] = true;
                    break;
                case KeyEvent.VK_S:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_B] = true;
                    break;
                case KeyEvent.VK_SPACE:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_SELECT] = true;
                    break;
                case KeyEvent.VK_ENTER:
                    keyboardState[JOYSTICK_PLAYER1 + JOYSTICK_START] = true;
                    break;
            }
        }