How to capture Key event in a NSApp?

  • Hi to all ,

    I want to capture the key press "p" event inside NSWindow to print the
    NSTextField Text.

    I know how to print NSTextField Text but i don't know how to capture
    the key press "p" inside NSWindow.

    Thanks.
  • Hi to all ,

    I want to capture the key press "p" event inside NSWindow to print the
    NSTextField Text.

    I know how to print NSTextField Text but i don't know how to capture
    the key press "p" inside NSWindow.

    Thanks.
  • On 17 okt 2006, at 22.36, Raul wrote:

    > I want to capture the key press "p" event inside NSWindow to print the
    > NSTextField Text.
    >
    > I know how to print NSTextField Text but i don't know how to capture
    > the key press "p" inside NSWindow.

    Why do you want to do it this way? What is the problem you're trying
    to solve?
    It's always easier to provide a good answer to a question if you know
    the background.
    You should most likely in any case study the conceptual documentation
    on NSResponder and the responder chain.

    j o a r
  • Use currentEvent method in NSAplication,

    [[NSApplication sharedApplication] currentEvent] --- Returns  the
    last event the receiver retrieved from the event queue.

    On 18-Oct-06, at 2:04 AM, Raul wrote:

    > Hi to all ,
    >
    > I want to capture the key press "p" event inside NSWindow to print the
    > NSTextField Text.
    >
    > I know how to print NSTextField Text but i don't know how to capture
    > the key press "p" inside NSWindow.
    >
    > Thanks.
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/apparao%
    > 40effigent.net
    >
    > This email sent to <apparao...>
    >
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today