[TxMt Plugins] sendAction Question

Kirt Fitzpatrick kirt.fitzpatrick at gmail.com
Sat Mar 31 21:20:42 UTC 2007


I have created a new project that distills out only the minimum code needed
for this plugin to send a message to the active window.  You can download it
here <http://fowpas.net/ViMate.zip> (http://fowpas.net/ViMate.zip).  It of
course does not work but I am hoping that someone may be able to tell me
why.  Here is the most relevant code.



@implementation ViPlugin
- (id)initWithPlugInController:(id <TMPlugInController>)aController
{
    NSLog( @"we have lift off!" );
    [ViWindow poseAsClass:[NSWindow class]];

    return [super init];
}
@end





@implementation ViWindow
- (void)sendEvent:(NSEvent *)theEvent
{
    if ( [theEvent type] == NSKeyDown ) {
        if ( [[theEvent charactersIgnoringModifiers] characterAtIndex: 0] ==
'h' ) {
            NSLog( @"we are trying to move left." );
            [[NSApplication sharedApplication] sendAction:
@selector(moveLeft:) to: nil from: self];
        } else {
            [super sendEvent:theEvent];
        }
    } else {
        [super sendEvent:theEvent];
    }
}
@end




thanks
kirt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate-plugins/attachments/20070331/57f41894/attachment.html>


More information about the textmate-plugins mailing list