| 3271 | |
| 3272 | /// {@inheritDoc} |
| 3273 | @Override |
| 3274 | public void keyRepeated(int keyCode) { |
| 3275 | if (focused != null) { |
| 3276 | if (focused.isEnabled()) { |
| 3277 | focused.keyRepeated(keyCode); |
| 3278 | } |
| 3279 | int game = Display.getInstance().getGameAction(keyCode); |
| 3280 | // this has issues in the WTK |
| 3281 | // Fix for issue 433: the focus might be changed by the key repeated method in a way that can turn it to null |
| 3282 | if (!focused.handlesInput() |
| 3283 | && (game == Display.GAME_DOWN || game == Display.GAME_UP || game == Display.GAME_LEFT || game == Display.GAME_RIGHT)) { |
| 3284 | keyPressed(keyCode); |
| 3285 | keyReleased(keyCode); |
| 3286 | } |
| 3287 | } else { |
| 3288 | keyPressed(keyCode); |
| 3289 | keyReleased(keyCode); |
| 3290 | } |
| 3291 | } |
| 3292 | |
| 3293 | private void initRippleEffect(int x, int y, Component cmp) { |
| 3294 | if (cmp.isRippleEffect()) { |