JDK-6506966 : COMPATIBILITY: Can't use the keypad to simulate game actions
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u1,7
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2006-12-21
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u1Fixed 7 b07Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
Tested OS/Browser:      
                        win 2000 pro(sp4)/ IE6
                        XP-Pro(sp2)/IE6 
                        
                                   
Tested build: jre-6u1-b01

Problem:
-------
Can't use keypad to play the game (simulate game actions).  It is a regression, compatibility issue with jre-6-fcs and MS VM. The problem starts to occur in 6u1-b01.


Steps to reproduce:
------------------
1) Install jre-6u1-b01 into the test system 
2) Using IE browser to load the game applet
   http://www.permadi.com/java/battletank/index.html   
3) Applet should be loaded. Follow instructions to start the game. 

In 6u1-b01, you can't use any of:
 
Left arrow to rotate left
Right arrow to rotate right
Up arrow to forward
Space to shoot
.....
.....

In short, you can't use keypad to play the game as instructed.  The game works fine using jre-6-fcs and MSVM.
This regression issue affects many client game applets from different sites (when applet games use keypad to simulate, operate game actions). Hence its priority is raised to P1 as must fix in 6u1.

We have noticed the same issue on following applets:

- http://www.permadi.com/java (Alien Troopers) --> the game controls are not working
- http://www.pogo.com (pogo.com - 3-Point Showdown) --> When used 'S' key to grab the ball or 'spacebar' to interact with applet, functionality is not
-  http://www.pogo.com (pogo.com - Heavy Cannon) --> Controls like 'spacebar���,��� Arrow keys��� are not working.  Unable to interact with the applet
- http://www.javaonthebrain.com. (Jayzees Maze) --> Controls of  ���Arrow keys���  are not working for the applet
- http://www.jagex.com (jagex.com - Monkey Puzzle) --> No Controls (Arrow keys/Space Bar) are working in the applet
- http://www.jgames.com (JGames.com - Navy Battle) -->  Key commands like N, 2 , 3, 4, 5 , Tab etc keys are not working.
- http://www.realapplets.com/app_arcade.asp (Real Invaders)--> Can't use "Enter" key to start the game

- http://www.java.com/en/games (vredungmand.dk - Mr, Hopwit and the Mysterious)
--> Arrow key controls are not working

- http://www.java.com/en/games (Radicalplay- Radical Aces) --> Can't user "Enter" key to continue with the game. 

-  http://www.jagex.com (Vertigo, Monkey Puzzle)--> No Controls (Arrow keys/Space Bar) are working in the applet.

Comments
SUGGESTED FIX +++ awt_Component.cpp 2006-12-27 22:03:10.000000000 +0300 @@ -2195,11 +2195,14 @@ if (sm_focusOwner == hwnd) { return TRUE; } HWND fgWindow = ::GetForegroundWindow(); - if (AwtComponent::GetComponent(fgWindow) == NULL) { + DWORD fgProcessID; + ::GetWindowThreadProcessId(fgWindow, &fgProcessID); + + if (fgProcessID != ::GetCurrentProcessId()) { // fix for 6458497. we shouldn't request focus if it is out of our application. return FALSE; } AwtFrame *owner = GetContainer()->GetOwningFrameOrDialog();
08-01-2007

EVALUATION 6506743 - Unable to enter the login information 6503816 - COMPATIBILITY: Chatting option doesn't work on many pogo, yahoo applets were closed as duplicates of this bug (need to test applets, mentioned in these CRs, with fix for this CR)
27-12-2006

EVALUATION this is a regression for fix for 6458497 (Reopen #4841881: Alt tab with Windows L&F moves focus to the application menubar). In that fix we do not allow to set native focus if current foreground window is not Java one. In our case foreground window is browser's window and we do not request focus. But the check is too restrictive, it should check if current foreground window created in another process. So, the fix is rather simple, but for 6u1 it would be safer to simple back out the original fix :(
27-12-2006

EVALUATION Most probably this is the same issue as 6506743 and 6503816.
26-12-2006