Steps to reproduce: 1. Run Main.java on laptops with no individual F1 and F2 keys (i.e. these two keys are functional keys as well) 2. Press fn+F1 or fn+F2 to select mode Actual Results: Game does not switch to the selected mode Expected Results: Game switches to the selected mode
Suspect the F1 key and F2 key are multiple function keys. Therefore, sometimes the computer does not take the F1 or F2 as input, but the computer shortcut command. May just change the F1 key and F2 key to 1 key or 2 key. Or we change change the key to 'P' key or 'A' key.
*** Bug 624 has been marked as a duplicate of this bug. ***
*** Bug 625 has been marked as a duplicate of this bug. ***
Changed key F1 & F2 to key 1 & 2. Code impletment: public void keyPressed(KeyEvent e) { if (SConstant.SC_GAME_MODE_DEFAULT.equals(game.getMode()) || SConstant.SC_GAME_MODE_PlAYER.equals(game.getMode())) { keyLock = SConstant.SC_DEFAULT_KEYBOARD_LOCK; } else { keyLock = SConstant.SC_UPDATED_KEYBOARD_LOCK; } if (SConstant.SC_DEFAULT_KEYBOARD_LOCK.equals(keyLock)) { switch (e.getKeyCode()) { case KeyEvent.VK_1: Press1KeyCommand.getInstance().execute(game); break; case KeyEvent.VK_2: Press2KeyCommand.getInstance().execute(game); break; case KeyEvent.VK_DOWN: PressDownKeyCommand.getInstance().execute(game); break; case KeyEvent.VK_LEFT: PressLeftKeyCommand.getInstance().execute(game); break; case KeyEvent.VK_RIGHT: PressRightKeyCommand.getInstance().execute(game); break; case KeyEvent.VK_UP: PressUpKeyCommand.getInstance().execute(game); break; case KeyEvent.VK_SPACE: timer.start(); break; } } }