cocoa: explicitly re-dispatch Cmd- key combinations

This commit is contained in:
Matthew Flatt 2010-11-30 15:39:02 -07:00
parent ca8b32725e
commit 72d57d8db8

View File

@ -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)