• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem receiving key events in CLI created window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem receiving key events in CLI created window


  • Subject: Re: Problem receiving key events in CLI created window
  • From: Dustin Voss <email@hidden>
  • Date: Fri, 18 Jul 2003 11:28:37 -0700

On Thursday, July 17, 2003, at 05:40 AM, Pete French wrote:

O.K., I have a very frustrating problem with a piece of long
standing code which has stopped working on the latest version
of OSX. The code worked fine on the public beta (last version I
had before Jaguar) and also on Rhapsody and OpenStep before that.

Which is kind of frustrating.

I have acommandline program which, when run, opens a window and draws into
it. It also receives events in that window using this:

event = [NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:the_past inMode:NSDefaultRunLoopMode dequeue:YES];

where 'the_past' is set to [NSDate distantPast] so that the call returns
immediately. For key events I process them myself, all other events are
then passed on using [NSApp sendEvent:event];

When I run the program I find that key events are still captured by the
terminal! Even with the window key and to the front, if I type then
the keypresses appear in the shell window the application is running from.

I am completely at a loss as to how to fix this, or what has changed to make
this suddenly stop working after five years!

I don't know what might have changed, or even how you are able to use AppKit in a command-line program, but I would check two things. First, are you running the run-loop? They don't start automatically in command-line programs. Second, did you make the window into the first responder? Can it accept that status?

Not much help, I know. Good luck.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Becomeing foreground process [was âRe: Problem receiving key events in CLI created window]
      • From: Pete French <email@hidden>
    • Re: Problem receiving key events in CLI created window
      • From: Pete French <email@hidden>
References: 
 >Problem receiving key events in CLI created window (From: Pete French <email@hidden>)

  • Prev by Date: Re: Hiding an NSMenu, or making keyboard shortcuts not tied to a menu item?
  • Next by Date: button in tableview header
  • Previous by thread: Problem receiving key events in CLI created window
  • Next by thread: Re: Problem receiving key events in CLI created window
  • Index(es):
    • Date
    • Thread