cocoa: explicitly re-dispatch Cmd- key combinations

original commit: 72d57d8db86b53adadef214fef051a78f9965bf5
This commit is contained in:
Matthew Flatt 2010-11-30 15:39:02 -07:00
parent 467341591e
commit 06ab79f133

View File

@ -41,8 +41,16 @@
;; Disable automatic handling of keyboard shortcuts, except for ;; Disable automatic handling of keyboard shortcuts, except for
;; the Apple menu ;; the Apple menu
(-a _BOOL (performKeyEquivalent: [_id evt]) (-a _BOOL (performKeyEquivalent: [_id evt])
(and the-apple-menu (or (and the-apple-menu
(tell #:type _BOOL the-apple-menu performKeyEquivalent: evt)))) (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 cocoa-mb (tell (tell MyBarMenu alloc) init))
(define current-mb #f) (define current-mb #f)