• 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: panels, windows, and the 'esc' key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: panels, windows, and the 'esc' key


  • Subject: Re: panels, windows, and the 'esc' key
  • From: PGM <email@hidden>
  • Date: Tue, 20 Feb 2007 23:59:04 -0500

Nearly every user function/command in my app can be done by using one key only. It makes the app very easy to use one handed and without the mouse, which is a relatively important part of it's design. I know I can subclass NSWindow and override -keyDown:, and I've done that for the main window. If I have to, that'll be the way I go. But the fact that one of the windows does what I'd like already without me being able to work out why is driving me nuts.


I do not know why one of your windows behaves differently, but you can make the window respond to keyboard shortcuts in a relatively easy way by adding a transparant dummy button in an unused corner of your window, the action of which you connect to the close-method of your window (or orderOut), and give that button the required keyboard shortcut.


If you don't want this button to be clickable you will have to do something like this:

//PMDummyButton.h
#import <Cocoa/Cocoa.h>
@interface PMDummyButton : NSButton {

}
@end

//PMDummyButton.m

#import "PMDummyButton.h"

@implementation PMDummyButton

- (void)mouseDown:(NSEvent *)theEvent
{
	//do nothing
}

@end

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: panels, windows, and the 'esc' key
      • From: Ron Fleckner <email@hidden>
References: 
 >panels, windows, and the 'esc' key (From: Ron Fleckner <email@hidden>)

  • Prev by Date: Re: Finding "myself" in a plugin architecture
  • Next by Date: Re: panels, windows, and the 'esc' key
  • Previous by thread: panels, windows, and the 'esc' key
  • Next by thread: Re: panels, windows, and the 'esc' key
  • Index(es):
    • Date
    • Thread