FROM : Matt Neuburg
DATE : Sat Jul 01 15:56:46 2006
On Fri, 30 Jun 2006 20:45:13 -0400, Travis Siegel <<email_removed>>
said:
>My keydown event is like this:
>- (BOOL) onKeyDown: (NSEvent *)theEvent
>========= [snip]
>What I can't figure out is how to pickup a key like command-L, or
>something more complex command-option-L.
There is no built-in Cocoa selector called "onKeyDown:", so you are not
revealing very clearly how you are expecting your code to be called.
However, be that as it may, the answer to your question is that you have to
understand two things: (1) the responder chain, and (2) the special
treatment of command-keys. These are very clearly explained in the
documentation, so the best thing is to read it:
...Cocoa/Conceptual/CocoaFundamentals/CoreAppArchitecture/chapter_7_section_
6.html
...Cocoa/Conceptual/BasicEventHandling/Concepts/AboutRespChain.html
And, most critically for your purposes:
...Cocoa/Conceptual/BasicEventHandling/Concepts/KeyEventPath.html
...Cocoa/Conceptual/BasicEventHandling/Concepts/KeyEquiv.html
m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
DATE : Sat Jul 01 15:56:46 2006
On Fri, 30 Jun 2006 20:45:13 -0400, Travis Siegel <<email_removed>>
said:
>My keydown event is like this:
>- (BOOL) onKeyDown: (NSEvent *)theEvent
>========= [snip]
>What I can't figure out is how to pickup a key like command-L, or
>something more complex command-option-L.
There is no built-in Cocoa selector called "onKeyDown:", so you are not
revealing very clearly how you are expecting your code to be called.
However, be that as it may, the answer to your question is that you have to
understand two things: (1) the responder chain, and (2) the special
treatment of command-keys. These are very clearly explained in the
documentation, so the best thing is to read it:
...Cocoa/Conceptual/CocoaFundamentals/CoreAppArchitecture/chapter_7_section_
6.html
...Cocoa/Conceptual/BasicEventHandling/Concepts/AboutRespChain.html
And, most critically for your purposes:
...Cocoa/Conceptual/BasicEventHandling/Concepts/KeyEventPath.html
...Cocoa/Conceptual/BasicEventHandling/Concepts/KeyEquiv.html
m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
| Related mails | Author | Date |
|---|---|---|
| Travis Siegel | Jul 1, 02:45 | |
| Shawn Erickson | Jul 1, 03:21 | |
| Matt Neuburg | Jul 1, 15:56 |






Cocoa mail archive

