From 06ab79f133497bf5b0c6580e8e6939b42792c7b2 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 30 Nov 2010 15:39:02 -0700 Subject: [PATCH] cocoa: explicitly re-dispatch Cmd- key combinations original commit: 72d57d8db86b53adadef214fef051a78f9965bf5 --- collects/mred/private/wx/cocoa/menu-bar.rkt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/collects/mred/private/wx/cocoa/menu-bar.rkt b/collects/mred/private/wx/cocoa/menu-bar.rkt index b8c70ae5..3bf4b065 100644 --- a/collects/mred/private/wx/cocoa/menu-bar.rkt +++ b/collects/mred/private/wx/cocoa/menu-bar.rkt @@ -41,8 +41,16 @@ ;; Disable automatic handling of keyboard shortcuts, except for ;; the Apple menu (-a _BOOL (performKeyEquivalent: [_id evt]) - (and the-apple-menu - (tell #:type _BOOL the-apple-menu performKeyEquivalent: evt)))) + (or (and the-apple-menu + (tell #:type _BOOL the-apple-menu performKeyEquivalent: evt)) + ;; Explicity send the event to the keyWindow: + (let ([w (tell app keyWindow)]) + (and w + (let ([r (tell w firstResponder)]) + (and r + (begin + (tell r keyDown: evt) + #t)))))))) (define cocoa-mb (tell (tell MyBarMenu alloc) init)) (define current-mb #f)