From 6feca8ff98277f83aa772ec241bca95f286dc3a9 Mon Sep 17 00:00:00 2001 From: trifonnt Date: Sat, 26 Mar 2011 00:06:29 -0500 Subject: [PATCH] BF [3092888] - AltGr+3rd level key fires wrong button https://sourceforge.net/tracker/?func=detail&atid=879332&aid=3092888&group_id=176962 --- org.adempiere.ui.swing/src/org/compiere/swing/CButton.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java b/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java index b581e1d730..8f0683820b 100644 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java +++ b/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java @@ -27,6 +27,7 @@ package org.compiere.swing; import java.awt.Color; import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; import javax.swing.Action; import javax.swing.Icon; @@ -315,6 +316,11 @@ public class CButton extends JButton implements CEditor { public void setMnemonic(int mnemonic) { super.setMnemonic(mnemonic); + // Angelo Dabala' (genied) avoid to register Ctrl+Alt modifier mask without mnemonic + if (mnemonic==KeyEvent.VK_UNDEFINED) { + return; + } + InputMap map = SwingUtilities.getUIInputMap(this, JComponent.WHEN_IN_FOCUSED_WINDOW);