Re: space bar keyboard short cut
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