treat keyboard input special and log it

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/branches/ptyview_with_pipes@39555 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2016-03-17 11:09:21 +00:00
parent d1a269c0cb
commit e082b8e3d7

View file

@ -279,6 +279,13 @@
[stdinHandle synchronizeFile];
}
/* for input as typed from the user, it needs to be shown too*/
- (void) typeString: (NSString *)string
{
[self putString:string];
[self logString:string newLine:NO];
}
/**
* Put a single character into the stream.
*/
@ -301,7 +308,10 @@
NSString *chars;
chars = [theEvent characters];
if ([chars length] == 1)
if ([chars length] == 0)
{
}
else if ([chars length] == 1)
{
unichar c;
c = [chars characterAtIndex: 0];
@ -314,11 +324,11 @@
}
if (c == 13) // CR
{
[self putString: @"\n"];
[self typeString: @"\n"];
}
else
{
[self putString: chars];
[self typeString: chars];
}
}
else