#import "CText.h"
#import "ComScroll.h"
#import <appkit/Application.h>

@implementation CText

- setController:sender;
{
   controller = sender ;
   [self setDelegate:controller] ;
   return self ;
}

/*
 *   We override keydown totally.  We just send the character to the
 *   terminal.  If we've set things up in echo mode properly, then we
 *   should get it back.  This provides better (but slower) feedback
 *   and gets around the modal loop that otherwise would be started
 *   here.
 */
- keyDown:(NXEvent *)theEvent;
{
   char buf[2] ;

   buf[0] = theEvent->data.key.charCode ;
/* [super keyDown:theEvent] ;  */
   buf[1] = 0 ; 
   if (buf[0] && controller)
      [(ComScroll *)controller sendToMaster:buf] ;
   return self ;
}

@end
