JDK-6191390 : Action Event triggered by list does not reflect the modifiers properly on win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2,8,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-11-05
  • Updated: 2016-05-24
  • Resolved: 2016-04-12
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 9
9 b116Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
I have a single selection list with few items. I am clicking an item and pressing ENTER with one of SHIFT / ALT / CTRL keys down. I expect the action event to return me these modifiers properly. But on Win32, the modifiers returned by the ActionEvent does not show any of these modifier keys.

This is reproducible only on Win32 since 1.4.2. This works fine on Solaris / Linux with XToolkit as well as Motif. 

Run the attached test. You would see a frame with a list. Keep any of the above mentioned modifier keys down and press ENTER. Check the ActionEvent shown on the console. If it does not show the modifier key you have pressed, the bug is reproduced.
###@###.### 2004-11-05 12:42:58 GMT

Comments
- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

EVALUATION This is issue specific to the AWT List component. The problem is following. There was a fix for cr#4421515. The fix introduces new modifiers. As part of the fix the KeyEvent class translates old modifiers into new modifiers. Taking into account the behaviour, the ctor of the ActionEvent class takes new modifiers as a parameter. Unfortunately, the AWT implementation of the List component still passes old modifiers into the ctor of the ActionEvent class. The difference between the AWT List component and other AWT components is that the List component triggers the action event ommiting any key event. This is excerpt from awt_List.cpp: MsgRouting AwtList::WmKeyDown(UINT wkey, UINT repCnt, UINT flags, BOOL system) { if (wkey == VK_RETURN) { WmNotify(LBN_DBLCLK); } return AwtComponent::WmKeyDown(wkey, repCnt, flags, system); } The WmNotify function of the awtList class calls the handleAction function of the WListPeer class upon the keyboard notification. The handleAction function creates the action event without taking care of modifiers. Thus, the action event includes old modifiers and so KeyEvent.getKeyModifiersText(modifiers) fails to print the old modifiers because the function expects new modifiers as a parameter. Perhaps it would be better to handle such notifications like other peers handle - send the Java key event to the component and create the Java action event as result of the key event.
21-08-2007

EVALUATION On Windows there are no any switched modifiers at all. The same on Solaris with MToolkit enabled. XAWT works fine. ###@###.### 2004-11-05 14:15:37 GMT
05-11-2004