Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move by Keyboard

  • Loading branch information...
commit 272f668808cd4a6945e79c512abfc083e4b80412 1 parent 27baf36
@pppoe authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 GetFrame/GetFrameWinController.m
View
30 GetFrame/GetFrameWinController.m
@@ -183,6 +183,36 @@ - (void)selectionMoved {
[self updateFieldContent];
}
+- (void)keyDown:(NSEvent *)theEvent {
+ if (![_selectionView isHidden] && !_isSelecting)
+ {
+ if ([[theEvent characters] length] > 0)
+ {
+ unichar c = [[theEvent characters] characterAtIndex:0];
+ NSPoint org = [_selectionView frame].origin;
+ switch (c) {
+ case NSLeftArrowFunctionKey:
+ org.x--;
+ break;
+ case NSRightArrowFunctionKey:
+ org.x++;
+ break;
+ case NSUpArrowFunctionKey:
+ org.y++;
+ break;
+ case NSDownArrowFunctionKey:
+ org.y--;
+ break;
+ default:
+ break;
+ }
+ [_selectionView setFrameOrigin:org];
+ [self selectionMoved];
+ [self updateFieldContent];
+ }
+ }
+}
+
@end
@implementation GetFrameWinController (Private)
Please sign in to comment.
Something went wrong with that request. Please try again.