JDK-6181174 : Pressing 'CTRL + SPACE' on a button triggers action event for button as well as menuitem, win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0,5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-10-19
  • Updated: 2011-01-19
  • Resolved: 2005-07-23
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
6 b45Fixed
Related Reports
Relates :  
Relates :  
Description
I am having a frame with a menu and a button. Menu has a menuitem with a shortcut (CTRL + SPACE). When the focus is in button, I am pressing CTRL + SPACE. When I do this, both the button as well as the menu item triggers the action event on win_xp. This is incorrect. When pressing ctrl + space, only the menu item should trigger the action event. This is how it works on solaris / linux with Motif as well as XToolkits. It does not make sense to make menuitem as well as button trigger action event for a menu shortcut. Moreover, the button does not look pressed visually in this case.

This is reproducible since 1.4 on Win-XP. I have attached a sample test. Execute the test. Make sure focus is on the button. Press 'CTRL + SPACE'. If you see 2 action events being triggered in the console, the bug is reproduced.
###@###.### 10/19/04 13:47 GMT

Comments
EVALUATION not a regression since JDK1.4. Will fix it in mustang. ###@###.### 10/20/04 07:53 GMT If we press shortcut combination like 'CTRL+SPACE' ActionEvent should not be triggered. It is provided by AWT implementation. But there was a bug in Windows implementation. If KeyEvent event was consumed (we conscientiously consumed KeyEvent if a shortcut was pressed) we could not consume ActionEvent (see 5087251). The problem is actual not only for buttons, but and for TextField. Last fix for 5087251 should fix the issue. ###@###.### 2005-07-11 04:56:10 GMT
20-10-2004