Re: space bar keyboard short cut
Re: space bar keyboard short cut
- Subject: Re: space bar keyboard short cut
- From: Karim Morsy <email@hidden>
- Date: Tue, 27 Jun 2006 21:30:13 +0200
that was it! thank you very much for the hint, nick!
On Jun 26, 2006, at 1:45 PM, nick briggs wrote:
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