summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets
diff options
context:
space:
mode:
authorSilenio Quarti <Silenio_Quarti@ca.ibm.com>2012-01-31 17:32:55 -0500
committerFelipe Heidrich <Felipe_Heidrich@ca.ibm.com>2012-01-31 17:32:55 -0500
commit0fc9a694d7469800fdb4849776d3de00cc1d2797 (patch)
treed2c894300531054af2acd9838a7cf29ef8255e02 /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets
parent49414e687e8dd970398fad4ea36d97ab635cb3a8 (diff)
downloadeclipse.platform.swt-0fc9a694d7469800fdb4849776d3de00cc1d2797.tar.gz
eclipse.platform.swt-0fc9a694d7469800fdb4849776d3de00cc1d2797.tar.xz
eclipse.platform.swt-0fc9a694d7469800fdb4849776d3de00cc1d2797.zip
Bug 368757 - Using ESC as accelerator does not work on OS X, but on
Windows
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
index a3aa7a3cf6..07d0b564c3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
@@ -2222,6 +2222,15 @@ void windowSendEvent (int /*long*/ id, int /*long*/ sel, int /*long*/ event) {
break;
case OS.NSKeyDown:
+ /*
+ * Feature in Cocoa. For some reason, Cocoa does not perform accelerators
+ * with ESC key code. The fix is to perform the accelerators ourselves.
+ */
+ if (nsEvent.keyCode() == 53 /* ESC */ && menuBar != null && !menuBar.isDisposed()) {
+ if (menuBar.nsMenu.performKeyEquivalent(nsEvent)) {
+ return;
+ }
+ }
/**
* Feature in cocoa. Control+Tab, Ctrl+Shift+Tab, Ctrl+PageDown and Ctrl+PageUp are
* swallowed to handle native traversal. If we find that, force the key event to