diff --git a/collects/mred/private/wx/cocoa/menu-bar.rkt b/collects/mred/private/wx/cocoa/menu-bar.rkt index 3bf4b065fe..a8c95b94c0 100644 --- a/collects/mred/private/wx/cocoa/menu-bar.rkt +++ b/collects/mred/private/wx/cocoa/menu-bar.rkt @@ -35,6 +35,7 @@ "MrEd")) (define the-apple-menu #f) +(define recurring-for-command (make-parameter #f)) (define-objc-class MyBarMenu NSMenu [] @@ -44,13 +45,16 @@ (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)))))))) + (and + (not (recurring-for-command)) + (let ([w (tell app keyWindow)]) + (and w + (let ([r (tell w firstResponder)]) + (and r + (begin + (parameterize ([recurring-for-command #t]) + (tell r keyDown: evt)) + #t))))))))) (define cocoa-mb (tell (tell MyBarMenu alloc) init)) (define current-mb #f)