• 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: space bar keyboard short cut
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: space bar keyboard short cut


  • Subject: Re: space bar keyboard short cut
  • From: nick briggs <email@hidden>
  • Date: Mon, 26 Jun 2006 12:45:02 +0100


Karim

You must subclass NSApplication and overide  sendEvent, see below,

In Xcode Targets -> Properties tab, enter your subclass name under PrincipalClass

Obviously something inyour responder chain must implement __SOME_SELECTOR__

----------------------------

@implementation MyApplication


- (void)sendEvent:(NSEvent *)event { if ([event type] == NSKeyDown) { NSString *str = [event characters]; if([str characterAtIndex:0] == 0x20) // spacebar { [super sendAction:@selector(__SOME_SELECTOR__:) to:nil from:self]; } } [super sendEvent:event]; }

@end

----------------------------

Nick





------------------------------

Message: 2
Date: Sun, 25 Jun 2006 14:04:35 +0200
From: Karim Morsy <email@hidden>
Subject: space bar keyboard short cut
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

hi,

I would like to assign the space (" ") key equivalent for a button
(like in itunes).
how can that be done ?

thanks,
Karim



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: space bar keyboard short cut
      • From: Karim Morsy <email@hidden>
  • Prev by Date: Re: project pointers and transition advice
  • Next by Date: Compositing to custom view with variable 'pen' and 'paper' colours.
  • Previous by thread: space bar keyboard short cut
  • Next by thread: Re: space bar keyboard short cut
  • Index(es):
    • Date
    • Thread