Skip to content

Commit

Permalink
Allow holding down the control button
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed May 31, 2020
1 parent 1946585 commit d2e1160
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/TerminalView.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,16 @@ - (void)setKeyboardAppearance:(UIKeyboardAppearance)keyboardAppearance {

- (void)insertText:(NSString *)text {
self.markedText = nil;

if (self.controlKey.highlighted)
self.controlKey.selected = YES;
if (self.controlKey.selected) {
self.controlKey.selected = NO;
if (!self.controlKey.highlighted)
self.controlKey.selected = NO;
if (text.length == 1)
return [self insertControlChar:[text characterAtIndex:0]];
}

text = [text stringByReplacingOccurrencesOfString:@"\n" withString:@"\r"];
NSData *data = [text dataUsingEncoding:NSUTF8StringEncoding];
[self.terminal sendInput:data.bytes length:data.length];
Expand Down

0 comments on commit d2e1160

Please sign in to comment.