Created
October 15, 2008 04:34
-
-
Save boucher/16857 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)keyDown:(CPEvent)anEvent | |
| { | |
| var keyCode = [anEvent keyCode]; | |
| var index = [[_documentsOutlineView selectionIndexes] firstIndex], | |
| count = [[_documentsOutlineView content] count]; | |
| switch(keyCode) | |
| { | |
| case 37: //left | |
| case 38: //up | |
| [_documentsOutlineView setSelectionIndexes:[CPIndexSet indexSetWithIndex:MAX(index-1, 0)]]; | |
| break; | |
| case 39: //right | |
| case 40: //down | |
| [_documentsOutlineView setSelectionIndexes:[CPIndexSet indexSetWithIndex:MIN(index+1, count-1)]]; | |
| break; | |
| default: [super keyDown:anEvent]; | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment