| 3226 | |
| 3227 | /// {@inheritDoc} |
| 3228 | @Override |
| 3229 | public void keyReleased(int keyCode) { |
| 3230 | int game = Display.getInstance().getGameAction(keyCode); |
| 3231 | if (menuBar.handlesKeycode(keyCode)) { |
| 3232 | menuBar.keyReleased(keyCode); |
| 3233 | return; |
| 3234 | } |
| 3235 | |
| 3236 | //Component focused = focusManager.getFocused(); |
| 3237 | if (focused != null) { |
| 3238 | if (focused.getComponentForm() == this) { //NOPMD CompareObjectsWithEquals |
| 3239 | if (focused.isEnabled()) { |
| 3240 | focused.keyReleased(keyCode); |
| 3241 | } |
| 3242 | } |
| 3243 | } |
| 3244 | |
| 3245 | // prevent the default action from stealing the behavior from the popup/combo box... |
| 3246 | if (game == Display.GAME_FIRE) { |
| 3247 | Command defaultCmd = getDefaultCommand(); |
| 3248 | if (defaultCmd != null) { |
| 3249 | defaultCmd.actionPerformed(new ActionEvent(defaultCmd, keyCode)); |
| 3250 | actionCommandImpl(defaultCmd); |
| 3251 | } |
| 3252 | } |
| 3253 | fireKeyEvent(keyListeners, keyCode); |
| 3254 | fireKeyEvent(gameKeyListeners, game); |
| 3255 | } |
| 3256 | |
| 3257 | private void fireKeyEvent(HashMap<Integer, ArrayList<ActionListener>> keyListeners, int keyCode) { |
| 3258 | if (keyListeners != null) { |