diff options
author | mltownsend <mltownsend@gmail.com> | 2009-08-28 05:16:37 +0000 |
---|---|---|
committer | mltownsend <mltownsend@gmail.com> | 2009-08-28 05:16:37 +0000 |
commit | 555e11adb2f626ae3c19e1e872bf47830e22a0b2 (patch) | |
tree | 1ef698ab6a2d4b876faf12310beeda911420e8e6 | |
parent | b4132a93b4cc370434b22c3ed8c644e6c850d9ad (diff) | |
download | sequelpro-555e11adb2f626ae3c19e1e872bf47830e22a0b2.tar.gz sequelpro-555e11adb2f626ae3c19e1e872bf47830e22a0b2.tar.bz2 sequelpro-555e11adb2f626ae3c19e1e872bf47830e22a0b2.zip |
Fixed keyDown editing of SPTableView and CMCopyTable
-rw-r--r-- | Source/CMCopyTable.m | 6 | ||||
-rw-r--r-- | Source/SPTableView.m | 15 |
2 files changed, 18 insertions, 3 deletions
diff --git a/Source/CMCopyTable.m b/Source/CMCopyTable.m index c28a5a3a..fadbe57d 100644 --- a/Source/CMCopyTable.m +++ b/Source/CMCopyTable.m @@ -418,13 +418,13 @@ int MENU_EDIT_COPY_AS_SQL = 2002; if([tableContentView numberOfSelectedRows] == 1 && ([theEvent keyCode] == 36 || [theEvent keyCode] == 76)) { if([[self delegate] tableView:tableContentView shouldEditTableColumn:[[tableContentView tableColumns] objectAtIndex:0] row:[tableContentView selectedRow]]) { [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES]; - return; } } - + } else { + [super keyDown:theEvent]; } - [super keyDown:theEvent]; + } diff --git a/Source/SPTableView.m b/Source/SPTableView.m index 4d97b6bb..cf93f143 100644 --- a/Source/SPTableView.m +++ b/Source/SPTableView.m @@ -59,4 +59,19 @@ return YES; } +- (void)keyDown:(NSEvent *)theEvent +{ + // Check if ENTER or RETURN is hit and edit the column. + if([self numberOfSelectedRows] == 1 && ([theEvent keyCode] == 36 || [theEvent keyCode] == 76)) + { + if (![[[[self delegate] class] description] isEqualToString:@"CustomQuery"]){ + [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES]; + return; + } + } + + [super keyDown:theEvent]; + +} + @end |