Professional Web Applications Themes

keyDown event without window - Mac Programming

How can I get keyDown events without a NSWindow? My guess is I have to get a subclass of a NSResponder on the responder chain. But how can I do that without using NSWindow's makeFirstResponder: method?...

  1. #1

    Default keyDown event without window

    How can I get keyDown events without a NSWindow? My guess is I have to
    get a subclass of a NSResponder on the responder chain. But how can I do
    that without using NSWindow's makeFirstResponder: method?
    Edward Hillenbrand Guest

  2. #2

    Default Re: keyDown event without window

    In <20030902022417744-0700news.sf.sbcglobal.net> Edward Hillenbrand
    wrote:
    > How can I get keyDown events without a NSWindow? My guess is I have
    > to get a subclass of a NSResponder on the responder chain. But how
    > can I do that without using NSWindow's makeFirstResponder: method?
    >
    If anyone cares to know I figured this one out. A subclass of
    NSApplication must be created. Then overide the sendEvent method in the
    subclass's implementation so it looks like this:

    - (void)sendEvent:(NSEvent *)theEvent
    {
    if(NSKeyDown == [theEvent type])
    NSLog("keyDown");
    }

    Next change the Target's 'Info.plist->Cocoa-Specific->Prinicpal class'
    to the name of the subclass. Then compile.
    Edward Hillenbrand Guest

Similar Threads

  1. keyDown
    By Anne in forum ASP.NET
    Replies: 9
    Last Post: May 31st, 04:02 PM
  2. Catching event before a window close
    By rene2233@adobeforums.com in forum Adobe Indesign Windows
    Replies: 1
    Last Post: June 10th, 12:50 PM
  3. window component from event listener
    By Flinchvoid in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: February 24th, 01:45 PM
  4. External Event + JavaScript/VBScript (open.window)
    By mr in forum Macromedia Director Lingo
    Replies: 3
    Last Post: September 4th, 01:26 PM
  5. open pop up window from asp server control event handler
    By Saravana in forum ASP.NET General
    Replies: 0
    Last Post: July 20th, 06:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139